Help with first wasm gauge

Hi, I am trying to learn how to create a wasm guage. I’ve been using the [following] as a guide. I have created the sample “MSFS WASM Gauge Demo”. I build the project and copy my wasm to

D:\mssimulatorcontent\Official\Steam\Asobo-aircraft-c172sp-classic\SimObjects\Airplanes\Asobo_C172sp_classic\panel

I add the following to the config file in the panel folder:

[VCockpit08] 
size_mm=1024,768 
pixel_size=1024,768 
texture=SCREEN_1 
background_color=0,0,255       
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=WASM_Gauge_Demo1.wasm&wasm_gauge=Compass, 0,0,1024,768   

[VCockpit09] 
size_mm=1024,768 
pixel_size=1024,768 
texture=SCREEN_2
background_color=0,255,0          
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=WASM_Gauge_Demo1.wasmm&wasm_gauge=Attitude, 0,0,1024,768   

[Vcockpit10] 
size_mm=1024,768 pixel_size=1024,768 
texture=SCREEN_3
background_color=255,0,0
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=WASM_Gauge_Demo1.wasm&wasm_gauge=Demo, 0,0,1024,768

(SDK Documentation)

I fire up MSFS, load C172 Classic, however I dont see the 2 gauges from he demo. I am not sure what steps I am missing. Any help is appreciated.
Thx

Is your .wasm module included in the layout.json file? If your file is not included in the layout.json then MSFS won’t load it (this applies to any file).

And fix your Vcockpit10 layout so sizemm and pixel size are on two different lines.

And why are they numbered 08 to 10? Start at 01 unless you have other entries there. I know in FSX not numbering things correctly doesn’t work. I assume MSFS is the same (I know it’s the same if you don’t number things properly in the electrical section).

Thanks. I fixed the typos and added an entry in the layout.json.

layout.json:
D:\mssimulatorcontent\Official\Steam\asobo-aircraft-c172sp-classic\layout.json

Entry:

 {
    "path": "SimObjects/Airplanes/Asobo_C172sp_classic/panel/WASM_Gauge_Demo1.wasm",
    "size": 795539,
    "date": 132773084118752031
}

Is this correct? Also, now I see the following errors in the logs:

WASM: Failed to load module  for gauge Compass (not found in the VFS)
WASM: Failed to load module  for gauge Attitude (not found in the VFS)
WASM: Failed to load module  for gauge Demo (not found in the VFS)

So I assume I have it in the wrong folder or the wrong layout.json?

Can you try this with the other plane, not protected? Just to be sure you are on a correct track and the problem is not the result of protection?

Hi. What do you mean protected? Do you mean the default aircraft that come with MSFS?

Did you try turning it off and back on again? I don’t think you can hotswap wasm gauges. Whenever you load an aircraft with a new gauge there is a pause in the load time as MSFS seems to convert the wasm file to whatever format it likes (and will CTD if it doesn’t like it). So, restarting MSFS should add the wasm to the virtual file system.

I don’t know what more to say. I have just copied the wasm sample gauge (SDK/Samples/Aircraft/GaugeAircraft) into the C172 panel folder (I have the basic version of MSFS so I don’t have the classic C172, just the as1000 version).

Added the layout information in alphabetical order as it seems to be:

    {
  "path": "SimObjects/Airplanes/Asobo_C172sp_AS1000/panel/panel.cfg",
  "size": 876,
  "date": 132617516490000000
},
{
  "path": "SimObjects/Airplanes/Asobo_C172sp_AS1000/panel/panel.xml",
  "size": 14707,
  "date": 132695367200000000
},
{
  "path": "SimObjects/Airplanes/Asobo_C172sp_AS1000/panel/SampleWasmModule.wasm",
  "size": 1102981,
  "date": 132550882200000000
},
{
  "path": "SimObjects/Airplanes/Asobo_C172sp_AS1000/runway.FLT",
  "size": 2776,
  "date": 132602943460000000
},

And added the information to the panel.cfg:

[VCockpit01]
size_mm=1024,768
pixel_size=1024,768
texture=$AS1000_PFD_1
background_color=42,42,40
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=SampleWasmModule.wasm&wasm_gauge=Compass, 0,0,1024,768

[VCockpit02]
size_mm=1024,768
pixel_size=1024,768
texture=$AS1000_PFD_2
background_color=42,42,40
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=SampleWasmModule.wasm&wasm_gauge=Attitude, 0,0,1024,768

[Vcockpit03]
size_mm=230,45
pixel_size=230,45
texture=$Hourmeter
emissive=0
htmlgauge00=Generic/Misc/HourMeter/HourMeter.html, 0, 0, 230, 45

It works, more or less, because it doesn’t have the data folder copied across.

Is there any reason you need to have this within the C172? I’d build the GaugeAircraft sample and use that if I was you.

Also, double check your syntax. I’ve spotted another error in your original code. wasmm instead of wasm on one of the lines.

Cessna-172 Classic (Steam gauges) is a Premium aircraft and is protected.

1 Like

Thanks. I think that the Cessna 172 Classic is protected and this was causing the problem. As to what I am trying to accomplish? I just want to see how a wasm is built and implemented. Now that I have a basic understanding of how it works, I dont think gauges is going to help what I want to accomplish.

I currently have my home cockpit which uses a mixture of Logitech panels and some external displays (7 Segment Displays), buttons using SimConnect and the SDK. My goal is to be able to pop out the GNS 530 to another monitor and be able to send softkey events from either a touchscreen or simconnect. Currently the GNS 530 events like Curser, zoom are not supported. I would like to implement something like RealSimGear’s GNS530.

Any suggestions? And again, thats for the help!

Sounds like you need a program that will take key inputs and convert them to commands that the GPS will process.

Isn’t this what FSUIPC does? Or the software for your controllers?

I know how to do it in Simconnect but it’s something you’d want in a standalone dll and not in a wasm gauge as they are aircraft specific.

With the new inputs that MSFS introduced this should be easy enough in theory.

Here is an example:

OneStore/fs-base-aircraft-common/modelbehaviorDefs/Asobo/AS430.xml

	l0 0 > if{
		(>B:#AS430#_Range_Zoom_Out)
	} els{
		(>B:#AS430#_Range_Zoom_In)
	}

You need a program that you can assign the B: code to a key input. #AS430# defaults to AS430 so it would be (>B:AS430_Range_Zoom_Out)

The new input functions take the processing out of the mouse section so all you need is to send a B: command and that will trigger the processing.

I believe this is something that FSUIPC can do. You’d need to download the demo and check it yourself.