can't get sensor to run - need your help please #26
-
Hi there First of all many thanks for this nice piece of hardware, the build-quality is nothing but excellent! I want to use the sensor with my MQTT-broker (Mosquito) on my Home Assistant instance. Unfortunately I struggle to connect the sensor and the Lora Gateway. I could upload the corresponding sketches onto the devices and MQTT sees the gateway. I live in Switzerland where the frequency is 868Mhz. Lora-Gateway: LilyGo TTGO LoRa32 868Mhz Version T3_V1.6.1 Arduino-sketch Mailbox_Guard_Sensor_MQTT_Auto_Discovery.ino. I just post the sections I have modified in the code.
Arduino-sketch LoRa_Gateway_MQTT_Auto_Discovery.ino. I just post the sections I have modified in the code.
I would appreciate your support, I cant figure out what I am doing wrong. I expected that when the PIR-sensor detects motion the state of the mailbox-entity in HA would change, but nothing happens. all the best Andrew |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hi Andrew, Thank you for supporting my work!!
In the gateway sketch, only this part needs to be changed
You modified the wrong part
Original "Don't touch"
In the sensor sketch the same thing |
Beta Was this translation helpful? Give feedback.
-
many thanks for your quick reply. I just changed the above mentioned code on both devices and enabled V1.6 in board.h (#define LORA_V1_6_OLED 1). I power the sensor via your UPDI-programmer from 3.3v to battery + and GND to battery -. I can see that the blue LED lights up when the PIR-sensor detects motion, so it seems that the sensor is basically working. However I suspect the issue with MQTT which is odd because other devices via MQTT work fine. The gateway can reach my MQTT-broker (official HA add-on) but I have several connects and disconnects. there are no logs under settings/system/logs in HA. A restart of the add-on and HA-instance didnt help. As other devices work fine via MQTT the issue comes probably from the gateway. The gateway gets a unique fixed IP-address. question: Are there any parameters I could change in the gateway-sketch to address the issue? I found this thread which is more or less the same issue I have https://community.home-assistant.io/t/mqtt-with-esp32-gives-timeout-disconnecting/260298 unfortunately there is no solution provided. environment |
Beta Was this translation helpful? Give feedback.
-
thats great thanks a lot! I will upload it ASAP really appreciate your support! here you go, gateway https://share.iot-dev.me/-sDj7A84Vnh / mailbox-sensor https://share.iot-dev.me/-x5VKy5gkiL |
Beta Was this translation helpful? Give feedback.
-
that was a good advice with the serial monitor, thanks. I uploaded the output (word-file) here: https://1drv.ms/w/s!Ald4PcI_y0i6h64mh7IKfBiX2i53NQ?e=iQQPWk I cant see the NewMailCode despite the mailbox-sensor is powered and the PIR-sensor detects motion. What I can see that the gateway speaks to the MQTT-server. could you read anything helpful from the serial output log? UPDATE: I finally could get it running. I uninstalled Arduino IDE and did a fresh install (legacy version 1.8). Then I pasted your libraries in the Arduino-folder and installed the two boards (ESP32 Version 2.0.14 and megaTiny Core). I put in my information/credential and uploded the sketch to the gateway. two final questions Q1: Is it intended that the binary_sensor.mailbox always displays open in HA even when there is no motion detected? Q2: Can I somehow get the state of the newmail-code (0xA2B2) in an entity within HA? You suggest to create an entity which reads LoRa-Gateway/Code but I use Auto-MQTT and dont have those entities. |
Beta Was this translation helpful? Give feedback.
that was a good advice with the serial monitor, thanks. I uploaded the output (word-file) here: https://1drv.ms/w/s!Ald4PcI_y0i6h64mh7IKfBiX2i53NQ?e=iQQPWk
I cant see the NewMailCode despite the mailbox-sensor is powered and the PIR-sensor detects motion. What I can see that the gateway speaks to the MQTT-server. could you read anything helpful from the serial output log?
UPDATE: I finally could get it running. I uninstalled Arduino IDE and did a fresh install (legacy version 1.8). Then I pasted your libraries in the Arduino-folder and installed the two boards (ESP32 Version 2.0.14 and megaTiny Core). I put in my information/credential and uploded the sketch to the gateway.
two final ques…