Jump to content
The simFlight Network Forums

FSUIPC 7 and Active Sky MSFS


Soundman1

Recommended Posts

There is currently no radar or associated functions provided by AS - basically there is no dll and so no dll functions to communicate with AS. This is currently being worked on by AS.

I believe there is a HTTP interface but I cannot find any documentation on this. I have asked AS about this and will take a look and see what is available / possible once I see the documentation and will then get back to you.

Link to comment
Share on other sites

On 5/15/2024 at 7:40 PM, Soundman1 said:

Is there any chance that FSUIPC can get weather/ATIS info from the new MSFS Active Sky?

After the latest AS update, the API documentation is now available in the AS documentation folder (Active_Sky_API.pdf) - could you take a look at this?

I am not sure what information I should request. I would have thought to use the GetCurrentConditions call. However I am not sure how useful this is - it seems to return the first string only from the Conditions tab of the AS UI - i.e. the Metar data. This is what this returns when on the runway at LEVX (Vigo, Spain):

@POS 201348Z 28012KT 250V320 9999 FEW019 SCT024 FEW028 16/10 Q1015 RMK ADVANCED INTERPOLATION

For comparison, this is what the AS UI shows under the Conditions tab:

Quote

@POS 201400Z 28012KT 250V320 9999 FEW018 SCT023 FEW027 16/10 Q1015 RMK AS DEPICTED
(Cloned by departure: LEVX)

FEW018 extends to:2134 feet (Cloud type:CU, Turbulence:None, Icing:None, Shear:Gradual, Cloud shape:Flat).  Previous cloud: None, next cloud: SCT023 (Through metar)
SCT023 extends to:2534 feet (Cloud type:CU, Turbulence:None, Icing:None, Shear:Gradual, Cloud shape:Flat).  Previous cloud: FEW018, next cloud: FEW027 (Through metar)
FEW027 extends to:18573 feet (Cloud type:CU, Turbulence:None, Icing:None, Shear:Gradual, Cloud shape:Flat).  Previous cloud: SCT023, next cloud: None (Through metar)

This station has complete visibility information. No interpolation needed
Altimeter interpolation based on:
  -LEST 40nm NE (Q1015), LEVX 2nm SE (Q1015), LPPR 62nm SW (Q1015)
This station has complete Precipitation information. No interpolation needed

NOTE: Clouds, visibility and precipitation reported are the ones from the active cell weather

 The GetMetarInfoAt call using the ICAO LEVX gives the following string:

LEVX 201400Z 28012KT 250V320 9999 FEW019 SCT024 FEW028TCU 16/10 Q1015 NOSIG

I guess I could extract the wind direction/speed, temperature, etc from the Metar string....

Or would the basic weather data (WindDirection, WindSpeed, Temperature, Pressure) at the aircraft position, using the GetAtmoshere call, be sufficient?

 

Link to comment
Share on other sites

  • 1 month later...

Hi John, 

Thanks for looking into this and apologies for taking a long time to respond.

I am guessing the GetMetarInfoAt would be necessary.   

The reason I'm curious about this is for Radar Contact. 
I know it's an old program but have to say even with the latest ATC offerings in MSFS (Beyond ATC / Say Intentions) RC is still superior in its flight handling and traffic interaction.

The problems are:

  1. It doesn't know the METAR at your Departure or Arrival airport.
  2. It doesn't read the pressure correctly at your location. Thus, thinks you are 5k to 10k below your assigned altitude. 


I've been trying to spoof the pressure into FSUIPC 7 using your example. But it still reads the altitude wrong. And using FS interrogate doesn't show me why it's reading it wrong as all altitude variables appear to read the altitude correctly.

Thanks again for your help on this.    
 

my lua script. 

local spoofOffset = 0xC028 -- Current Pressure (2 bytes)

-- Loop forever
while true do

  -- Get value of Altimeter Setting
  Altimeter = ipc.readSW(0x0EC6)
  
  -- and write it via 0024 as overrides to those being read 
  ipc.writeStruct(0x0024, "1UW", spoofOffset, "1UW", 2, "1SW", Altimeter)

  -- Sleep for 100 mSecs so the update gets done roughly 10 times per second
  ipc.sleep(100)

end
 



 
      
     

Link to comment
Share on other sites

On 6/24/2024 at 8:01 PM, Soundman1 said:

The reason I'm curious about this is for Radar Contact. 
I know it's an old program but have to say even with the latest ATC offerings in MSFS (Beyond ATC / Say Intentions) RC is still superior in its flight handling and traffic interaction.

Ah...that is interesting... Do you have this more or less working then? The main problem with using RC with MSFS, or so I thought, was the display of messages and menus which isn't working correctly due to the broken SimConnect_Tect functionality in MSFS. I would be interested to know if this is working, or how you got this working....

On 6/24/2024 at 8:01 PM, Soundman1 said:

The problems are:

  1. It doesn't know the METAR at your Departure or Arrival airport.
  2. It doesn't read the pressure correctly at your location. Thus, thinks you are 5k to 10k below your assigned altitude. 


I've been trying to spoof the pressure into FSUIPC 7 using your example. But it still reads the altitude wrong. And using FS interrogate doesn't show me why it's reading it wrong as all altitude variables appear to read the altitude correctly.

Thanks again for your help on this.    

Which offsets is RC reading for the METAR information?

Offset 0x0EC6 is incorrectly flagged as not available in MSFS, but I have checked the code and that offset should be populated. However, the weather offsets starting at 0xC000 are disabled in MSFS, so I am not sure spoofing a read to that area will work. Id RC reading the (sea level) pressure at offset 0xC028 then? And doesn't it require the altimeter pressure, not the sea level pressure?

Link to comment
Share on other sites

2 hours ago, John Dowson said:

Do you have this more or less working then? The main problem with using RC with MSFS, or so I thought, was the display of messages and menus which isn't working correctly due to the broken SimConnect_Tect functionality in MSFS. I would be interested to know if this is working, or how you got this working....

  • Yes! It works about 90%. The only frustrating part is getting RC to read my altitude correctly. I have to set the deviation in RC to 10000 so it doesn't admonish me.
  • I use Show Text to display the messages from RCv4. That works great as well. 
2 hours ago, John Dowson said:

Which offsets is RC reading for the METAR information?

For airport info I believe RC is looking for the metar info usually supplied by 0XC000. (I don't have my p3dv5 installed so I can't confirm this.)  ATIS info in RC comes out as all zeros and clear skies. My thought was to take metar info supplied by Active Sky and populate it into FSUIPC for RC to read. If it's even possible. Since I'm kindergarten level coder, I have no idea how to code that in LUA.
But maybe I'm looking at it wrong and I should try to find a way to take 0x0570 and send it to 0X31E4? Which, according to FS-Interrogate, disagree. Is it possible to take a 64bit offset and send it to a 32bit offset?      

Screenshot 2024-06-29 072725.png

Link to comment
Share on other sites

On 6/29/2024 at 5:27 PM, Soundman1 said:

For airport info I believe RC is looking for the metar info usually supplied by 0XC000. (I don't have my p3dv5 installed so I can't confirm this.)  ATIS info in RC comes out as all zeros and clear skies. My thought was to take metar info supplied by Active Sky and populate it into FSUIPC for RC to read. If it's even possible. Since I'm kindergarten level coder, I have no idea how to code that in LUA.
But maybe I'm looking at it wrong and I should try to find a way to take 0x0570 and send it to 0X31E4? Which, according to FS-Interrogate, disagree. Is it possible to take a 64bit offset and send it to a 32bit offset?      

You don't need to convert from 64bit to 32bit. The units part of the altitude is available at offset 0x0574 as a 32-bit value, and you would need to multiply by 65536 to spoof this value to offset 0x31E4. But I am not sure this will help, and doesn't offset 0x31E4 hold the correct value (RADIO HEIGHT) anyway?
I think its more likely that you need to spoof the reading of offset 0xC000, but that is going to be very difficult I think. 

On 6/24/2024 at 8:01 PM, Soundman1 said:

I am guessing the GetMetarInfoAt would be necessary.   

If I called this function, I could maybe use the results to populate offset 0xB000, but not sure that would help. I could not populate the 0xC000 offset area from this data.

I will check further on how the 0xC000 is populated in FSX/P3D, but I think this was done via the simconnect weather interface which is just not available in MSFS.

Link to comment
Share on other sites

On 7/4/2024 at 3:54 AM, John Dowson said:

I will check further on how the 0xC000 is populated in FSX/P3D, but I think this was done via the simconnect weather interface which is just not available in MSFS.

You're correct. According to FS Interrogate, this value is being read correctly. I originally stated the 0570 and 31E4 disagree but this is not correct on a recent flight they do indeed agree and display the correct altitude.      

 

On 7/4/2024 at 3:54 AM, John Dowson said:

If I called this function, I could maybe use the results to populate offset 0xB000, but not sure that would help. I could not populate the 0xC000 offset area from this data.

I will check further on how the 0xC000 is populated in FSX/P3D, but I think this was done via the simconnect weather interface which is just not available in MSFS.

Thanks so much for your help on this. I understand can't be done.  

Link to comment
Share on other sites

1 hour ago, Soundman1 said:

I understand can't be done.

Well, never say never...

I think first we need to determine exactly what offsets RC4 is reading, and once we know that we can see if we can spoof the values.
Could you activate logging for IPC Reads and Writes, and generate a FSUIPC7.log file when using RC4. If you could show me that, that would tell me what offsets its using. Hopefully its only reading and not writing.

Link to comment
Share on other sites

3 hours ago, John Dowson said:

I think first we need to determine exactly what offsets RC4 is reading, and once we know that we can see if we can spoof the values.
Could you activate logging for IPC Reads and Writes, and generate a FSUIPC7.log file when using RC4. If you could show me that, that would tell me what offsets its using. Hopefully its only reading and not writing.

Will do!

Link to comment
Share on other sites

Hi John, 

Here's two logs one of the IPC_Writes. I think mainly it is writing to the RCv4 MENU facility in FSUIPC.

The Reads log I had to cut down because a flight from LAX to LAS generated a 2gig log. Mainly 0560 and 0568 Which are lat and lon being read about 100 times a millisecond.    

I do think all the necessary info is there, however.

Let me know if you think this is missing anything important. The one thing interesting I noticed is that it is reading 0574 and sometimes 0570. 

It was still off by about 5000 feet. When the controller passed off to another the pilot would respond with "with you at 24k" when they were only at 19k. 

Thanks!

Jim      

RCv4_IPC Write LOG.txt RCv4_IPC READS.txt

Link to comment
Share on other sites

Hi again. 
An addendum to this. This is what I believe RCV4 wants to read for the Metar response in the program. I was able to spoof some of these with other info.   

RCV4 Wants to read -------------------------------------------------                      Can we spoof from? --------------------------------- 
READ0[12760]  CC10,   8 bytes: 00 00 00 00 00 00 00 00  - Weather Lat                - 065C - Nearest Airport Lat?
READ0[12760]  CC18,   8 bytes: 00 00 00 00 00 00 00 00  - Weather Lon               - 0660 - Nearest Airport Lon?
READ0[12760]  CC28,   2 bytes: 2D 3F                               - QNH                            - 0EC6 - I can spoof QNH correctly
READ0[12760]  CEA2,   2 bytes: 00 00                                - Cloud Lower alt [3]      - ?
READ0[12760]  CEA6,   1 bytes: 00                                     - Cloud Coverage [3]      - ?
READ0[12760]  CE82,   2 bytes: 00 00                                 - Cloud Lower alt [1]      - ?
READ0[12760]  CE86,   1 bytes: 00                                      - Cloud Coverage [1]      - ?
READ0[12760]  CE92,   2 bytes: 00 00                                  - Cloud Lower alt [2]     - ?
READ0[12760]  CE96,   1 bytes: 00                                       - Cloud Coverage [2]     - ? 
READ0[12760]  CC3E,   2 bytes: 00 00                                  - Dewpoint                    - 04C8 - DEW POINT?       
READ0[12760]  CE8D,   1 bytes: 00                                       - Precipitation Rate       - 2E00 - PRECIP RATE?         
READ0[12760]  CE8C,   1 bytes: 00                                       - Precipitation Type       - 04CC - PRECIP TYPE?
READ0[12760]  CC3A,   2 bytes: 00 00                                  - Temp Daytime             - 0E8C - TEMP   I can spoof           
READ0[12760]  CC30,   2 bytes: 00 00                                   - Visibility Range           - 0E8A - Visibility I can spoof           
READ0[12760]  CD02,   2 bytes: 00 00                                   - Wind Direction             - 0E92 - Wind Direction I can spoof        
READ0[12760]  CD00,   2 bytes: 00 00                                   - Wind Gust Differential  - ?
READ0[12760]  CCFE,   2 bytes: 00 00                                    - Wind Speed                   - 0E90 - WINDS SPEED I can spoof        
     

Link to comment
Share on other sites

Were you running any other FSUIPC clients (including WideClient) when you generated those logs? Better to not have anything else running (except WideClient, but only if running RC on a client machine). This also includes lua scripts, as it looks like these are also logged. A single log file containing RC reads/writes would be the most useful, and it doesn't have tpo be that big. Once RC is running and working but has the incorrect altitude, exit FSUIPC7 and then attach the file.

I don't think you will need to spoof everything that RC is reading, only what is necessary. For example, probably not necessary to spoof cloud info (and this is not available anyway!). If the main issue is with the altitude, then this is what needs to be read correctly. You can also just spoof them with dummy values for now - they don't have to be accurate for the time being.

On 7/8/2024 at 4:42 AM, Soundman1 said:

The one thing interesting I noticed is that it is reading 0574 and sometimes 0570. 

Thats okay though, as those offsets are populated correctly, no?

18 hours ago, Soundman1 said:

RCV4 Wants to read -------------------------------------------------                      Can we spoof from? --------------------------------- 
READ0[12760]  CC10,   8 bytes: 00 00 00 00 00 00 00 00  - Weather Lat                - 065C - Nearest Airport Lat?
READ0[12760]  CC18,   8 bytes: 00 00 00 00 00 00 00 00  - Weather Lon               - 0660 - Nearest Airport Lon?
READ0[12760]  CC28,   2 bytes: 2D 3F                               - QNH                            - 0EC6 - I can spoof QNH correctly
READ0[12760]  CEA2,   2 bytes: 00 00                                - Cloud Lower alt [3]      - ?
READ0[12760]  CEA6,   1 bytes: 00                                     - Cloud Coverage [3]      - ?
READ0[12760]  CE82,   2 bytes: 00 00                                 - Cloud Lower alt [1]      - ?
READ0[12760]  CE86,   1 bytes: 00                                      - Cloud Coverage [1]      - ?
READ0[12760]  CE92,   2 bytes: 00 00                                  - Cloud Lower alt [2]     - ?
READ0[12760]  CE96,   1 bytes: 00                                       - Cloud Coverage [2]     - ? 
READ0[12760]  CC3E,   2 bytes: 00 00                                  - Dewpoint                    - 04C8 - DEW POINT?       
READ0[12760]  CE8D,   1 bytes: 00                                       - Precipitation Rate       - 2E00 - PRECIP RATE?         
READ0[12760]  CE8C,   1 bytes: 00                                       - Precipitation Type       - 04CC - PRECIP TYPE?
READ0[12760]  CC3A,   2 bytes: 00 00                                  - Temp Daytime             - 0E8C - TEMP   I can spoof           
READ0[12760]  CC30,   2 bytes: 00 00                                   - Visibility Range           - 0E8A - Visibility I can spoof           
READ0[12760]  CD02,   2 bytes: 00 00                                   - Wind Direction             - 0E92 - Wind Direction I can spoof        
READ0[12760]  CD00,   2 bytes: 00 00                                   - Wind Gust Differential  - ?
READ0[12760]  CCFE,   2 bytes: 00 00                                    - Wind Speed                   - 0E90 - WINDS SPEED I can spoof        

That is interesting....how did you determine what those offsets are holding?

The problem with the area at CC00-CFFF is that this is weather at 'the requested location', i.e. I would expect to see writes to offsets C800-C8FF to specify the location before these offsets are read, but I see no writes at all for this area. However, I do see writes to the 'weather at requested location; read area CC00-CFFF:

Quote

   515782 WRITE0[12264]  CC10,   8 bytes: 00 00 00 20 B8 F8 40 40                          ... ..@@
   515782 WRITE0[12264]  CC18,   8 bytes: 00 00 00 C0 29 9A 5D C0                          ....).].
   515782 WRITE0[12264]  CC08,   4 bytes: 20 20 20 20                                          
   515782 WRITE0[12264]  CC04,   2 bytes: 5B 6F                                            [o

Not sure where those are coming from - are they being spoofed (via lua)?

 

Link to comment
Share on other sites

Hi John.

Quote:
I don't think you will need to spoof everything that RC is reading, only what is necessary. For example, probably not necessary to spoof cloud info (and this is not available anyway!). If the main issue is with the altitude, then this is what needs to be read correctly. You can also just spoof them with dummy values for now - they don't have to be accurate for the time being. 

Yeah, that's what I'm doing with fairly good success.

I don't need to spoof 0570 or 0574 as they seem to be reading correctly and RC seems to only be off by 1000 feet now.  

I have been able to spoof
QNH into CC28 - from 0EC6
Ambient Temp - into CC3A - from 0E8C
Visibility - into CC30 from 0E8A
Wind Direction - into CD02 from 0E92
Wind Speed - into CCFE from 0E90

I can confirm this works because the ATIS readback in RC is being populated with these values. And FS Interrogator confirms it as well.

Other values like precipitation, overcast, dew point and such I'm not sure where to grab those.

I ran the test /log without any luas running so the writes

 515782 WRITE0[12264]  CC10,   8 bytes: 00 00 00 20 B8 F8 40 40                          ... ..@@
   515782 WRITE0[12264]  CC18,   8 bytes: 00 00 00 C0 29 9A 5D C0                          ....).].
   515782 WRITE0[12264]  CC08,   4 bytes: 20 20 20 20                                          
   515782 WRITE0[12264]  CC04,   2 bytes: 5B 6F                                            [o      

Are being done by RC. According to FS - Interrogate
CC10 Weather read Latitude - 
 CC18 Weather read Longitude - 
CC08   ICAO for weather reading (FS2004)
CC04 Signature for weather reading (FS2004) - With Instructions:  

Write the signature last, just before the FSUIPC_Process, after setting one of:

ICAO = Id of a valid FS  Wx station, or
ICAO = 'GLOB' for global weather, or
ICAO = 4 spaces plue Lat/Lon

If your signature is accepted the weather will be available a short time after, after a timestamp change. Read the whole lot including the ICAO/Lat/Lon, and check the ICAO or Lat/Lon to see if it is yours. If not try again a while later (100-500 mSecs at least -- best to vary it).

 

Link to comment
Share on other sites

14 hours ago, Soundman1 said:

I don't need to spoof 0570 or 0574 as they seem to be reading correctly and RC seems to only be off by 1000 feet now.  

I have been able to spoof
QNH into CC28 - from 0EC6
Ambient Temp - into CC3A - from 0E8C
Visibility - into CC30 from 0E8A
Wind Direction - into CD02 from 0E92
Wind Speed - into CCFE from 0E90

Sounds good, but I wonder why it is still off by 1000 feet - it would be useful to know where/how it is deriving this altitude.

14 hours ago, Soundman1 said:

Are being done by RC. According to FS - Interrogate
CC10 Weather read Latitude - 
 CC18 Weather read Longitude - 
CC08   ICAO for weather reading (FS2004)
CC04 Signature for weather reading (FS2004) - With Instructions:  

Write the signature last, just before the FSUIPC_Process, after setting one of:

ICAO = Id of a valid FS  Wx station, or
ICAO = 'GLOB' for global weather, or
ICAO = 4 spaces plue Lat/Lon

If your signature is accepted the weather will be available a short time after, after a timestamp change. Read the whole lot including the ICAO/Lat/Lon, and check the ICAO or Lat/Lon to see if it is yours. If not try again a while later (100-500 mSecs at least -- best to vary it).

This sounds strange as offsets CC00-CFFF are documented as the area to READ the weather at the requested location.
The writable area is C800-CBFF. To be honest I am not sure how these offsets work - I will take a look in more detail next week, Maybe worth checking these in FSUIPC6 with P3D, or maybe with FSUIPC4 in FSX.

The Active Sky files may contain some useful data, especially the current_wx_snapshot.txt file:

Quote

current_wx_snapshot.txt – Provides the entire global weather data in use including METARs, TAFs and Winds Aloft. Winds aloft data is provided per-altitude block which follows the altitude blocks listed in the “Conditions” screen of ACTIVE SKY.

Maybe worth taking a look at that file.

I will see if I can look into this in more detail next week sometime.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.