jeelabs / el-client

Arduino client for esp-link's REST, MQTT, and command interface
BSD 2-Clause "Simplified" License
85 stars 47 forks source link

MQTT example not working #14

Closed walduino closed 8 years ago

walduino commented 8 years ago

Ive downloaded https://github.com/jeelabs/el-client/blob/v2.2.beta2/ELClient/examples/mqtt/mqtt.ino imported the libs from the same tag, and flashed my arduino I put https://github.com/jeelabs/esp-link/releases/tag/v2.2.beta2 on my esp8266.

The webpage shows esp-link v2.2.beta2 - 2016-02-27 11:08:17 - 1d0f313 so thats ok, I think

Problem is all I'm getting in the serial console is

EL-Client starting! ����EL-Client sync failed! ����EL-Client sync failed! ����EL-Client sync failed! ����EL-Client sync failed! ����EL-Client sync failed!

AFAIK the hardware should be ok , as the pcb works just fine when i cuse a combo if tuans esp firmware and his espduino lib. Sound a lot like https://github.com/jeelabs/esp-link/issues/119 bit that one's closed :S I tried lowering the baudrate on both sides, to no avail. any ideas ?

walduino commented 8 years ago

Yeah ok first problem was mine ; on the services page ...Enable SLIP on serial port ... quite essential But I run into the next problem: 133084> MQTT: Connect to 192.168.1.125:1883 0x3fff6108 133090> MQTT: TCP connected to 192.168.1.125:1883 133090> MQTT: Send type=TYPE_CONNECT id=0000 len=21 133104> MQTT: Disconnect CB, freeing espconn 0x3fff6108 133105> MQTT: Disconnected from 192.168.1.125:1883 133105> MQTT: Disconnected cb=0x0000027d 133105> cmdResponse: cmd=3 val=637 argc=0

Am running a Mosquitto 0.15-2ubuntu1 and see this in my syslog Apr 13 02:44:19 swordsman hostapd: wlan0: STA 18:fe:34:f3:3a:52 IEEE 802.11: authenticated Apr 13 02:44:19 swordsman hostapd: wlan0: STA 18:fe:34:f3:3a:52 IEEE 802.11: associated (aid 4) Apr 13 02:44:19 swordsman hostapd: wlan0: STA 18:fe:34:f3:3a:52 WPA: pairwise key handshake completed (RSN) Apr 13 02:44:19 swordsman dnsmasq-dhcp[7967]: DHCPDISCOVER(br-lan) 18:fe:34:f3:3a:52 Apr 13 02:44:19 swordsman dnsmasq-dhcp[7967]: DHCPOFFER(br-lan) 192.168.1.236 18:fe:34:f3:3a:52 Apr 13 02:44:19 swordsman dnsmasq-dhcp[7967]: DHCPREQUEST(br-lan) 192.168.1.236 18:fe:34:f3:3a:52 Apr 13 02:44:19 swordsman dnsmasq-dhcp[7967]: DHCPACK(br-lan) 192.168.1.236 18:fe:34:f3:3a:52 esp-link Apr 13 02:44:19 esp-link - esp-link esp_link 0.184832 1 Reset cause: 0=normal Apr 13 02:44:19 esp-link - esp-link esp_link 0.185050 2 exccause=0 epc1=0x0 epc2=0x0 epc3=0x0 excvaddr=0x0 depc=0x0 Apr 13 02:44:19 esp-link - esp-link esp_link 0.185358 3 Flash map 512KB:256/256, manuf 0xC8 chip 0x4013 Apr 13 02:44:19 esp-link - esp-link esp_link 0.185759 4 \ esp-link ready Apr 13 02:44:19 esp-link - esp-link esp_link 0.186121 5 initializing MQTT Apr 13 02:44:19 esp-link - esp-link esp_link 0.186875 6 initializing user application Apr 13 02:44:19 esp-link - esp-link esp_link 0.187025 7 Waiting for work to do... Apr 13 02:44:19 esp-link - esp-link SYSLOG 13.285531 8 syslogserver: 192.168.1.125:514 25980 Apr 13 02:44:19 odroid mosquitto[534]: New connection from 192.168.1.236. Apr 13 02:44:19 odroid mosquitto[534]: Invalid protocol "MQTT" in CONNECT from 192.168.1.236. Apr 13 02:44:19 odroid mosquitto[534]: Socket read error on client (null), disconnecting. Apr 13 02:44:20 odroid mosquitto[534]: New connection from 192.168.1.236. Apr 13 02:44:20 odroid mosquitto[534]: Invalid protocol "MQTT" in CONNECT from 192.168.1.236. Apr 13 02:44:20 odroid mosquitto[534]: Socket read error on client (null), disconnecting. Apr 13 02:44:22 odroid mosquitto[534]: New connection from 192.168.1.236. Apr 13 02:44:22 odroid mosquitto[534]: Invalid protocol "MQTT" in CONNECT from 192.168.1.236. Apr 13 02:44:22 odroid mosquitto[534]: Socket read error on client (null), disconnecting. Apr 13 02:44:26 odroid mosquitto[534]: New connection from 192.168.1.236. .........

walduino commented 8 years ago

looks like i might have opened this issue a bit too soon https://github.com/tuanpmt/esp_mqtt/issues/36 might just be my old mosquitto

walduino commented 8 years ago

since i'm using an ARMhf cpu i installed this package https://packages.debian.org/jessie/armhf/mosquitto/download

seems to work quite fine now , thanks