diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 583e3ff..e40281b 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -62,7 +62,8 @@ module.exports = { 'upload/binaries', 'upload/pio', 'upload/arduino-ide', - 'upload/portal' + 'upload/portal', + 'upload/troubleshoot' ] }, { diff --git a/docs/img/OpenMQTTGateway_TTGO32_LORA_Receive.jpg b/docs/img/OpenMQTTGateway_TTGO32_LORA_Receive.jpg new file mode 100644 index 0000000..5d353f6 Binary files /dev/null and b/docs/img/OpenMQTTGateway_TTGO32_LORA_Receive.jpg differ diff --git a/docs/img/OpenMQTTGateway_TTGO32_LORA_Send.jpg b/docs/img/OpenMQTTGateway_TTGO32_LORA_Send.jpg new file mode 100644 index 0000000..b1c92a2 Binary files /dev/null and b/docs/img/OpenMQTTGateway_TTGO32_LORA_Send.jpg differ diff --git a/docs/img/OpenMQTTGateway_Wifi_Manager_enter_parameters.png b/docs/img/OpenMQTTGateway_Wifi_Manager_enter_parameters.png new file mode 100644 index 0000000..74cf7d7 Binary files /dev/null and b/docs/img/OpenMQTTGateway_Wifi_Manager_enter_parameters.png differ diff --git a/docs/img/OpenMQTTGateway_Wifi_Manager_menu.png b/docs/img/OpenMQTTGateway_Wifi_Manager_menu.png new file mode 100644 index 0000000..cc0ec33 Binary files /dev/null and b/docs/img/OpenMQTTGateway_Wifi_Manager_menu.png differ diff --git a/docs/img/OpenMQTTGateway_Wifi_Manager_save.png b/docs/img/OpenMQTTGateway_Wifi_Manager_save.png new file mode 100644 index 0000000..6078983 Binary files /dev/null and b/docs/img/OpenMQTTGateway_Wifi_Manager_save.png differ diff --git a/docs/prerequisites/board.md b/docs/prerequisites/board.md index e60a8b3..061ec9c 100644 --- a/docs/prerequisites/board.md +++ b/docs/prerequisites/board.md @@ -13,6 +13,7 @@ Here is some information to find the board suitable for your need, you have the |Sonoff RF Bridge (*) |X|[needs an hack](https://1technophile.blogspot.com/2018/02/adding-infrared-emitter-to-sonoff-rf.html)|-|-|-|-|-| |All bare ESP32|-|-|X|-|-|-|-| |M5Stack Basic|-|-|X|-|-|-|-| +|M5Stick|-|sending|X|-|-|X|X| |M5Stick C|-|sending|X|-|-|X|X| |TTGO LORA32|-|-|-|X|-|-|-| |Sonoff RFR3|receiving [needs an hack](https://1technophile.blogspot.com/2019/08/new-sonoff-rfr3-as-433tomqtt-gateway.html)|-|-|-|-|X|X| diff --git a/docs/upload/pio.md b/docs/upload/pio.md index 17d29a2..907a9c5 100644 --- a/docs/upload/pio.md +++ b/docs/upload/pio.md @@ -25,7 +25,7 @@ default_envs = esp32dev-rf ;default_envs = ttgo-lora32-v1 ``` -If you don't know which env to activate you can refer to [devices](prerequisites/devices). +If you don't know which env to activate you can refer to [devices](../prerequisites/devices). The different listed configurations represents some standard environments, to overload them with special parameters or modules you can modify the config files. The definitions coming from [platformio.ini](https://github.com/1technophile/OpenMQTTGateway/blob/development/platformio.ini) file and config files are cumulative. The main config file is [user_config.h](https://github.com/1technophile/OpenMQTTGateway/blob/development/main/User_config.h), added to it you have one config file per gateway, sensor or actuator, you will find them in the [main](https://github.com/1technophile/OpenMQTTGateway/tree/development/main) folder. diff --git a/docs/upload/portal.md b/docs/upload/portal.md index 585c44f..8e6ac93 100644 --- a/docs/upload/portal.md +++ b/docs/upload/portal.md @@ -2,13 +2,24 @@ Once loaded into your board and if you don't use the manual configuration you have to set your network parameters with wifi manager portal. From your smartphone search for your OpenMQTTGateway wifi network and connect to it, a web page will appear + +![Wifi manager menu](../img/OpenMQTTGateway_Wifi_Manager_menu.png) + +* Click on Configure WiFi + +![Wifi manager parameters](../img/OpenMQTTGateway_Wifi_Manager_enter_parameters.png) + * Select your wifi * Set your wifi password * Set your MQTT Server IP -* Set your MQTT Server username (not compulsory) -* Set your MQTT Server password (not compulsory) -* Set your MQTT base topic (you must keep the / at the end) -* Set your gateway name +* Set your MQTT Server username (facultative) +* Set your MQTT Server password (facultative) +* Set your MQTT base topic if you need to change it (you must keep the / at the end) +* Set your gateway name if you need to change it + +* Click on save + +![Wifi manager save](../img/OpenMQTTGateway_Wifi_Manager_save.png) The ESP restart and connect to your network. Note that your credentials are saved into the ESP memory, if you want to redo the configuration you have to erase the ESP memory with the flash download tool. @@ -20,5 +31,4 @@ home/OpenMQTTGateway/LWT Online home/OpenMQTTGateway/version ``` -Note that the web portal appears only on first boot, if you want to configure again the setting you can do a long press on TRIGGER_PIN. - +Note that the web portal appears only on first boot, if you want to configure again the setting you can do a long press on TRIGGER_PIN or [erase the settings](../use/gateway.md#erase-the-esp-settings). diff --git a/docs/upload/troubleshoot.md b/docs/upload/troubleshoot.md new file mode 100644 index 0000000..a8cfcfd --- /dev/null +++ b/docs/upload/troubleshoot.md @@ -0,0 +1,58 @@ +# Troubleshooting + +## Compilation/build error +This badge [![Build Status](https://travis-ci.org/1technophile/OpenMQTTGateway.svg?branch=master)](https://travis-ci.org/1technophile/OpenMQTTGateway) show you the state of the compilation of the master and this one [![Build Status](https://travis-ci.org/1technophile/OpenMQTTGateway.svg?branch=development)](https://travis-ci.org/1technophile/OpenMQTTGateway) for the development branch. If you see a green badge this means that the code compilation is OK with the configuration given in the docs/platformio.ini. Check your IDE environment version, boards version, libraries version before submitting an issue or a question. +Verify especially that the libraries provided into the [the release page](https://github.com/1technophile/OpenMQTTGateway/releases) are located into your "sketchbook folder"/libraries if your are using the Arduino IDE. + +## ESP32 compilation errors related to wifi +If you get one or several of the following errors: + +`error: 'WIFI_STA' was not declared in this scope` + +`error: 'class WiFiClass' has no member named 'mode'` + +`error: no matching function for call to 'WiFiClass::macAddress()` + +You have a conflict between Arduino default wifi library and ESP32 one. So as to resolve this issue you should move or remove the Arduino wifi library (Arduino Sketchbook folder\libraries\WiFi) in order to enable the IDE to take the one from ESP32 (Arduino Sketchbook folder\hardware\espressif\arduino-esp32\libraries\WiFi) +More info on [this topic](https://community.openmqttgateway.com/t/esp32-compilation-error/144/5?u=1technophile) + +## Not able to send or receive RF or IR +→ Verify your power supply voltage with a multimeter, it should be 5V (can be 12V for FS1000A emitter), please note that on NodeMCU V3 the Vin does not supply 5V contrary to NodeMCU V1 + +→ Verify your wiring + +→ To eliminate issues of OpenMqttGateway or you home controller try uploading basic examples from the libraries directly (like [SendDemo](https://github.com/sui77/rc-switch/tree/master/examples/SendDemo) for RF or IRSendDemo for IR) and execute them. If it doesn't work this means that you have mostly an issue related with your hardware or due to IDE/library version used. + +Regarding the IR led emitter you can replace it with a normal led and see if it light on when you send an mqtt command + +→ If you are only unable to receive RF on nodemcu (or if it only works when a serial connection is active): + +try with D2 instead of D3 +and put +define RF_RECEIVER_PIN 4 // D2 on nodemcu +in config_rf.h +instead of +define RF_RECEIVER_PIN 0 // D3 on nodemcu + +## Exception seen on serial monitor: +Hey I got a callback +malloc +memcpy +7 +Exception (2): + +→ You are not using the last update of ESP8266 into board manager, go to your Arduino IDE and update it, should be at least 2.3.0 + +## You don't see the messages appearing on your broker but they appears on the serial monitor +This is due to a too small mqtt packet size, open pubsubclient.h from pubsubclient library and set: +try to modify in pubsubclient.h: +`#define MQTT_MAX_PACKET_SIZE 1024` +The other option is to use the [pubsubclient library](https://github.com/1technophile/OpenMQTTGateway/tree/master/lib/pubsubclient) provided in the OMG repository folder. + +## Your Arduino with w5100 Ethernet shield does not connect to network until you press Reset button +If you notice that your Arduino with w5100 Ethernet shield does not connect to network until you press its Reset button, but connects fine if you connect the Arduino with a USB cable to a computer/laptop with Arduino IDE running and open Serial Monitor, the problem is most likely the Ethernet shield and/or the power supply you're using. +According to this [video](https://www.youtube.com/watch?v=9ZBeprOqC3w&feature=youtu.be), w5100 clones sometimes struggle to initialise because the reset pin wasn't held low long enough. The solution is simple - add a 0.1uF (100nF) capacitor between the pins on the reset switch. You can get more details [here](http://forum.arduino.cc/index.php?topic=28175.15). +But even with this fix your board might not work well with a specific PSU. I would recommend try at least one different one and also try bigger capacitor (some report using 47uF) + +If you didn't find your answer here post a question to the forum: +[![Community forum](https://img.shields.io/badge/community-forum-brightgreen.svg)](https://community.openmqttgateway.com) diff --git a/docs/use/lora.md b/docs/use/lora.md index bdda03c..227c88f 100644 --- a/docs/use/lora.md +++ b/docs/use/lora.md @@ -5,16 +5,26 @@ Subscribe to all the messages with mosquitto or open your MQTT client software: ` sudo mosquitto_sub -t +/# -v` -Generate your LORA signals by using another TTGO LORA module, you can flash the sender program from [this repository](https://github.com/LilyGO/TTGO-LORA32-V2.0) +Generate your LORA signals by using another TTGO LORA module, you can flash the sender program from [this repository](https://github.com/LilyGO/TTGO-LORA32-V2.0) and the SSD1306 library [there](https://github.com/ThingPulse/esp8266-oled-ssd1306) -Once one board flashed with OMG and the other with the sender program you should receive regular packets. +![](../img/OpenMQTTGateway_TTGO32_LORA_Send.jpg) + +Once one board flashed with OMG and the other with the sender program you should receive regular packets into `home/OpenMQTTGateway_ESP32_LORA_TEST/LORAtoMQTT` like below: + +```json +{"rssi":-16,"snr":9.25,"pferror":-3598,"packetSize":9,"message":"hello 35"} +{"rssi":-26,"snr":9,"pferror":-3598,"packetSize":9,"message":"hello 36"} +{"rssi":-16,"snr":9.5,"pferror":-3581,"packetSize":9,"message":"hello 37"} +``` ## Send data by MQTT to convert it on LORA signal -`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoLORA -m '{"message":"test8"}'` +`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoLORA -m '{"message":"hello OMG1"}'` -This command will send by LORA the message "test8" and use the default parameters defined in [config_LORA.h](https://github.com/1technophile/OpenMQTTGateway/blob/4b8d28179b63ae3f3d454da57ec8c109c159c386/config_LORA.h#L32) +This command will send by LORA the message "hello OMG1" and use the default parameters defined in [config_LORA.h](https://github.com/1technophile/OpenMQTTGateway/blob/4b8d28179b63ae3f3d454da57ec8c109c159c386/config_LORA.h#L32) -If you want to test that your sending works you can use another TTGO LORA module, you can flash the receiver program from [this repository](https://github.com/LilyGO/TTGO-LORA32-V2.0) +![](../img/OpenMQTTGateway_TTGO32_LORA_Receive.jpg) + +If you want to test that your sending works you can use another TTGO LORA module, you can flash the receiver program from [this repository](https://github.com/LilyGO/TTGO-LORA32-V2.0) and the SSD1306 library [there](https://github.com/ThingPulse/esp8266-oled-ssd1306) ## Send data by MQTT with advanced LORA parameters