Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodemcu v2 doesn't not receive any publish msg in recv topic #36

Open
subzero79 opened this issue Jun 26, 2018 · 1 comment
Open

nodemcu v2 doesn't not receive any publish msg in recv topic #36

subzero79 opened this issue Jun 26, 2018 · 1 comment

Comments

@subzero79
Copy link

Being working on this now two months, i still cannot get the software to send a single rf signal via mqtt. I suspected the rf transmitter, but going now through the third different one i have doubts now on the fw.

I have tried the default release, as well as my own build binary. I have a couple of issues using the settings as changing the mqtt password, resulted in admin password defaulted so no RF. So i put all my passwords, topic, etc in settings.h

So far from reading the log i can see MQTT433gateway connects to the MQTT broker successfully, i can confirm this on the mosquitto server debug log seeing several messages from the device:

1530014897: Sending PINGRESP to rf434
1530014900: Received PINGREQ from DVES_375428
1530014900: Sending PINGRESP to DVES_375428
1530014900: Received PINGREQ from DVES_14C4FE
1530014900: Sending PINGRESP to DVES_14C4FE
1530014906: Received PUBLISH from DVES_375428 (d0, q0, r0, m0, 'sonoff/switch/lounge/tele/STATE', ... (156 bytes))
1530014906: Received PUBLISH from DVES_375428 (d0, q0, r0, m0, 'sonoff/switch/lounge/tele/SENSOR', ... (160 bytes))
1530014906: Sending PUBLISH to e9f3c689-6ac0-45de-aed5-cf41262004e8 (d0, q0, r0, m0, 'sonoff/switch/lounge/tele/SENSOR', ... (160 bytes))
1530014912: Received PINGREQ from milight-hub-1493872
1530014912: Sending PINGRESP to milight-hub-1493872
1530014912: Received PINGREQ from rf434
1530014912: Sending PINGRESP to rf434
1530014915: Received PINGREQ from DVES_375428
1530014915: Sending PINGRESP to DVES_375428
1530014915: Received PINGREQ from DVES_14C4FE
1530014915: Sending PINGRESP to DVES_14C4FE
1530014924: Received PINGREQ from mqtt_3672cb7d.1352a4
1530014924: Sending PINGRESP to mqtt_3672cb7d.1352a4

Now when i send any message via mqtt, the gateway doesn't log anything. Looking at others peoples issues here the received message should be something like:

Message arrived bla bla
rf send bla bla

This is a simple command made from the payloads from the wiki to test i use:

mosquitto_pub  -h ha.lan -u homeassistant -P password -t "rf/send/impuls/" -m '{"systemcode":24,"programcode":2,"on":1}'

or

mosquitto_pub  -h ha.lan -u homeassistant -P password -t "rf/send/impuls" -m '{"systemcode":24,"programcode":2,"on":1}'

Message is published as i can see it my subscribe terminal. But yet the serial terminal or web console don't log anything at all. The second command topic without slash crashes the nodemcu as you can see in the serial log

Loading config file.
Applying config settings.
Change status LED config: pin=16 activeHigh=0
configPassword: password
*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 10.10.0.30
Configure logging.
RfHandler Instance created.
Configure WebServer.
Starting webserver and websocket server.
WebServer instance created.
Configure rfProtocols.
Configure rfEchoMessages.
Try to (re)connect to MQTT broker
MQTT connected.
MQTT subscribe to topic: rf/send/+
MQTT subscribed.
MQTT instance created.
MDNS service registered.
Change status LED config: pin=16 activeHigh=0
Current configuration:
{
  "deviceName": "rf434",
  "mqttBroker": "10.10.0.152",
  "mqttBrokerPort": 1883,
  "mqttUser": "homeassistant",
  "mqttRetain": false,
  "mqttReceiveTopic": "rf/recv/",
  "mqttSendTopic": "rf/send/",
  "rfEchoMessages": false,
  "rfReceiverPin": 12,
  "rfTransmitterPin": 4,
  "rfReceiverPinPullUp": true,
  "rfProtocols": [],
  "serialLogLevel": "debug",
  "webLogLevel": "debug",
  "syslogLevel": "",
  "syslogHost": "",
  "syslogPort": 514,
  "ledPin": 16,
  "ledActiveHigh": false
}
Listen on IP: 10.10.0.30
Websocket client 0 connected

Exception (9):
epc1=0x40229f03 epc2=0x00000000 epc3=0x00000000 excvaddr=0x566e6b32 depc=0x00000000

ctx: cont 
sp: 3fff1e10 end: 3fff2050 offset: 01a0

>>>stack>>>
3fff1fb0:  3fff1fe0 00000001 0000000e 402188a2  
3fff1fc0:  3fff6e9c 3fff6ae0 00000000 40219032  
3fff1fd0:  732f6672 2f646e65 75706d69 4000736c  
3fff1fe0:  00000001 3fff0dc4 3fff69b0 4020a20d  
3fff1ff0:  401065e0 00000000 00001388 3fff1020  
3fff2000:  00000000 00000000 3fff6ae0 3fff1020  
3fff2010:  3fff0dc0 3fff0dc4 3fff7e24 4020f1a9  
3fff2020:  00000000 00000000 3fff0db8 4022b59d  
3fff2030:  3fffdad0 00000000 3fff1019 40211100  
3fff2040:  feefeffe feefeffe 3fff1030 402134b0  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld
Load Settings...
Loading config file.
Applying config settings.
Change status LED config: pin=16 activeHigh=0
configPassword: password
*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 10.10.0.30
Configure logging.
RfHandler Instance created.
Configure WebServer.
Starting webserver and websocket server.
WebServer instance created.
Configure rfProtocols.
Configure rfEchoMessages.
Try to (re)connect to MQTT broker
MQTT connected.
MQTT subscribe to topic: rf/send/+
MQTT subscribed.
MQTT instance created.
MDNS service registered.
Change status LED config: pin=16 activeHigh=0
Current configuration:
{
  "deviceName": "rf434",
  "mqttBroker": "10.10.0.152",
  "mqttBrokerPort": 1883,
  "mqttUser": "homeassistant",
  "mqttRetain": false,
  "mqttReceiveTopic": "rf/recv/",
  "mqttSendTopic": "rf/send/",
  "rfEchoMessages": false,
  "rfReceiverPin": 12,
  "rfTransmitterPin": 4,
  "rfReceiverPinPullUp": true,
  "rfProtocols": [],
  "serialLogLevel": "debug",
  "webLogLevel": "debug",
  "syslogLevel": "",
  "syslogHost": "",
  "syslogPort": 514,
  "ledPin": 16,
  "ledActiveHigh": false
}
Listen on IP: 10.10.0.30
Websocket client 0 connected

So clearly the second command should be the correct one as the gw seems to receive it, but something is not working.

Can you clarify if not even having the transmitter connected to the gw should still try send the code right and of course log it right?

@puuu
Copy link
Owner

puuu commented Nov 6, 2018

The trailing / is too much. Also, for debugging it is not required to connect any transmitter/receiver on the esp. You should still see the debug messages.

Here is an example ("mqttReceiveTopic": "rf/recv/", "mqttSendTopic": "rf/send/", "serialLogLevel": "debug"):

$ mosquitto_pub -t "rf/send/impuls" -m '{"systemcode":24,"programcode":2,"on":1}'

Serial console:

New MQTT message: rf/send/impuls .. {"systemcode":24,"programcode":2,"on":1}
transmit rf signal {"systemcode":24,"programcode":2,"on":1} with protocol impuls
transmitted pulse train with 50 pulses

You can also connect rfReceiverPin with rfTransmitterPin via a wire. By enabling rfEchoMessages you should get:

New MQTT message: rf/send/impuls .. {"systemcode":24,"programcode":2,"on":1}
transmit rf signal {"systemcode":24,"programcode":2,"on":1} with protocol impuls
transmitted pulse train with 50 pulses
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=0 repeats=1 deviceID=
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} with protocol impuls
Publish MQTT message: rf/recv/impuls retain=0 .. {"systemcode":24,"programcode":2,"state":"on"}
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=3 repeats=103 deviceID=
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=3 repeats=104 deviceID=
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=3 repeats=105 deviceID=
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=3 repeats=106 deviceID=
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=3 repeats=107 deviceID=
rf signal received: {"systemcode":24,"programcode":2,"state":"on"} protocol=impuls status=3 repeats=108 deviceID=

If your esp crashes during processing a MQTT message, please check your power supply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants