Webinterface of wifi-node for home cockpits
en,  Flight simulation / aviation,  Software & scripting

WiFi-node

Cheep universal homecockpit IoT devices for annunciator panels

My Wifi-Node project was created to build a wifi connected IoT device for Homecockpit annunciators that connects to the simulator via the FSUIPC Websocket Server (by Paul Henty).
Based on that, it doesn’t require any HW interface (USB) to the simulator computer.
Just +5V and a Wifi-connection.

The idea

I wanted to have an easy to setup and cheap implementation for annunciators. And it should not require any additional USB-ports. Based on my experience with my own FSUIPC websocket-server i decided to go now this way using the one provided by FSUIPC.


from https://app.code2flow.com/flowcharts/63695948c1f51984423128dd

NodeMCU V3

I’m using the NodeMCU V3 – an ESP8266 based Arduino Board carrying a couple of IOs and onboard-Wifi as base for the project.

MCP23017 pinout schematics
pinout by mischianti.org

Port expanders

As a typical Homecockpit – especially for airliners – requires plenty of Outputs for the annunciators / Korry switches i decided to extend the ESP8266 via Inter-IC Bus (I2C) using the MCP23017 Port Expanders with 16 configurable IOs per each. The three bit addressing of them supports the use of up to 8 MCP23017 so that i’m able to extend one NodeMCU for up to 128 digital outputs aka LEDs.

MCP23017

MCP23017 pinout schematics

Wiring

Caution
follow the counting of pins around the notch to continue from 0-7 on one side (shown in the picture on the upper side) and from 8-15 on the side where also VCC, GND and SDA, SCA are connected. So IO 15 is opposite of IO 0.
wifi-node wiring schematics

Shown here as example for the i2c Addresses 32 and 33 (possible up to 39) and with LEDs connected to

coloraddress.pin
green32.0
blue32.1
orange33.0
white33.1

Use

  1. If you like connect your wifi-node to the I2c Bus with the MCP port extenders
  2. Power up your your wifi-node – either using the Micro-USB Jack or the external Power pins
  3. Search for the WiFi access point the wifi-node as spawned and connect to it via SSID: WifiNodeAP
  4. Open the Website of the WifiNodeAP on http://192.168.4.1 (not via HTTPS as no certificate is provided!)
    You will get: 
  5. click on „Configure WiFi“ and you’ll get
     
  6. select your found WiFi from the list (or key-in your SSID manually) and provide the WiFi password of the selected WiFi Network and click „Save“. It will result in 
  7. Take care… If the wifi-node is unable to connect, it will revert to the AP mode again.
  8. If the wifi-node could join your selected WiFi, you can also connect to it. Check which IP has been assigned to it – via your WiFi routers admin interface or a network scan – and open the wifi-nodes website via HTTP in your browser again. For instance then via http://192.168.178.15
  9. Finally you only need to provide the configuration which you want to use via HTTP PUT on /config. See specification for config including example at the REST API description.
  10. If you provided a config and connected it to I2C bus, it might look for instance like this: 
    That offers the ability to see directly which I2C MCP23017 port extenders have been found and test the functions (switch the Outputs ON or OFF via webinterface) without the need of having a sim connected.

REST API

See https://app.swaggerhub.com/apis-docs/JOACHIMHERWIG/wifi-node/ for the REST API specification.

Contributing

Probably you want push this script a small step or a big leap forward. You’re welcome to do so. Just ask me for access to the private repo, fork it, check-in your changes and send me a pull-request.
If you’re not familiar with using Github you can also send me a Email to inform me about the changes and additions you made, and i’ll probably embed them into my repo.

Bugs and feature requests

Have a bug or a feature request? Please check first whether your problem or idea is addressed already. If not, please feel free to open a new issue.

Code and documentation copyright 2021 by Joachim Herwig and not licensed for anybody.

Docs released under Creative Commons.