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

No MQTT messages #7

Open
w4Rd3n opened this issue Feb 3, 2021 · 31 comments
Open

No MQTT messages #7

w4Rd3n opened this issue Feb 3, 2021 · 31 comments

Comments

@w4Rd3n
Copy link

w4Rd3n commented Feb 3, 2021

Hello.
Thank you all for the great work on this.
I have some problems with the fork of Emmanuel:
https://github.com/EmmanuelLM/esp8266_spa

I use a Wemos D1 mini Pro
and this config:

#define VERSION "0.32"
#define WIFI_SSID "TP-Link_F526"
#define WIFI_PASSWORD "******"
#define BROKER "192.168.1.170"
#define BROKER_LOGIN "loxberry"
#define BROKER_PASS "********"
#define AUTO_TX true //flag for the RS485/TTL chip - i.e. do we need to pull D1 or not....

So far Wemos is connected to my wifi but i dont receive any spa message on my broker.
I have subscribed to Spa/# topic.

At the moment i don't have the spa connectet to the RS485 TTL transceiver.
But anyway i should get some mqtt messages, no ?

I am powering the wemos and transceiver with 5V output of my DC-DC converter

Here is a photo of the HW:
IMG_20210203_153635
Mirror Image of rear view HW:
IMG_20210203_155654

@w4Rd3n w4Rd3n changed the title No Topic messages No MQTT messages Feb 3, 2021
@w4Rd3n
Copy link
Author

w4Rd3n commented Feb 3, 2021

I don't use external Antenna on the D1 mini for now. Ping is working but usually 1 of 4 packets are lost wheni execute the command.
The Webserver is not working. it keeps saying connection timeout and then reloads page

@cribskip
Copy link
Owner

cribskip commented Feb 3, 2021

@EmmanuelLM s fork is tested with me in PR #6 but up to now, my tests were not successful besides the code looking great.

Maybe you should try my current code first to debug potential connectivity issues as it publishes when the wemos connects to the broker.

Tidy setup btw :-D

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Feb 3, 2021

My fork is "work in progress" ;-)

From my experience, I had issues with the RS485 to TTL transceiver and found [and I do not know why] that the device would just not work if it didn't receive messages (c.f. issue #4 - similar symptoms to yours)...

I agree with @cribskip - test his code first :)

p.s. #define AUTO_TX true -> this should be false with your transceiver
p.p.s. try connecting your Spa to A & B

@w4Rd3n
Copy link
Author

w4Rd3n commented Feb 4, 2021

Thanks for your inputs.
For now i only powered the board without the spa connection.
i was assuming i ll get some mqtt messages also without the spa connected.
I will let you know how this continues :)

@Michael0yodi
Copy link

Did you ever find any solution I've similar issue, I can see that it reports to my broker

1622540317: New connection from 172.16.0.121 on port 1883.
{"result": "ok", "data": {}}1622540317: New client connected from 172.16.0.121 as Spa8861 (p2, c1, k10, u'mqttuser').
1622540332: Client Spa8861 has exceeded timeout, disconnecting.
1622540338: New connection from 172.16.0.121 on port 1883.
1622540338: New client connected from 172.16.0.121 as Spa8852 (p2, c1, k10, u'mqttuser').

But no matter if connected or not to the spa I never get any data via mqtt
webserver on D1 just give me this "Not found: /" not sure if expected?

I've it running on usb power without using the dc-dc converter, but since ground is not connected on the rs485 I guess it "should" work, rxd is flashing so looks like data is received

image

@EmmanuelLM
Copy link
Contributor

Hello, a few things as it looks like you are nearly there.

If you are powering off usb (or anything else), you need all GND to be connected together otherwise the signal 'floats' - likewise, with the hot tub GND.

if you go to the webserver, go to http://you_ip/update - nothing shows in the root as you have seen.

@pato-loco
Copy link

@EmmanuelLM what do you mean with "all GND to be connected together"?

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Jun 14, 2021 via email

@Michael0yodi
Copy link

I've tried to make sure that gnd are common with the spa using a dc-dc converter, but it still behaves the same so not sure where to start troubleshooting, any ideas are welcome

@pato-loco
Copy link

pato-loco commented Jul 4, 2021

I've tried to make sure that gnd are common with the spa using a dc-dc converter, but it still behaves the same so not sure where to start troubleshooting, any ideas are welcome

bridge (-) from the DC-converter "in" and (-) from the DC-converter "out" directly together.

@Michael0yodi
Copy link

should I also connect the GND on the RS485 transceiver? I've used RS485 before with no common ground so its a bit strange that its not working at all, could of course be something else also..

@tonyfitzs
Copy link

hi there, I am also having issues with MQTT. as reported above, I can see in the logs of my broker that the D1 Mini running this code is trying to connect to the brocker and its trying to send a message as follows

1632863671: New connection from 10.110.x.x on port 1883.
1632863671: New client connected from 10.110.x.x as Spa1 (p2, c1, k10, u'test').
1632863665: Client Spa1 has exceeded timeout, disconnecting.

but the subscription isnt ever completed before it disconects. i am wondering if the code I am using is the right version (VERSION "0.35"), because the webpage, dosnt do anything either, and based on above it looks like it is suposed to. if I try to hit http://10.110.x.x/update I get a page time out. perhaps I am misunderstanding the purpose of this url, because the documentation has a few gaps, is this an OTA address rather than a webpage that shows you information.

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Sep 29, 2021 via email

@tonyfitzs
Copy link

tonyfitzs commented Sep 29, 2021 via email

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Sep 29, 2021 via email

@tonyfitzs
Copy link

tonyfitzs commented Sep 29, 2021 via email

@Michael0yodi
Copy link

If you dont want it to reset you can just comment out the hardreset(); or set #define PRODUCTION false
I did however never manage to get any mqtt messages to arrive beside the debug/connect ones, I thought my rs485 adapter might be broken, (same version as yours) but never got around to order another one, so please let us know if you make any progress

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Sep 29, 2021 via email

@tonyfitzs
Copy link

tonyfitzs commented Sep 29, 2021 via email

@DutchTrickle
Copy link

p.s. #define AUTO_TX true -> this should be false with your transceiver p.p.s. try connecting your Spa to A & B

How do i find whether or not this is the case for my transceiver?

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Oct 20, 2021 via email

@DutchTrickle
Copy link

DutchTrickle commented Oct 20, 2021

https://www.amazon.nl/gp/product/B07DJ4TGY3/

I've also noticed, that if i turn on the D1 mini, the red light on the transceiver turns off (it turns on again if i power off the D1). Is it supposed to be on or blinking when its receiving data?

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Oct 20, 2021 via email

@DutchTrickle
Copy link

AUTOTX should be true as per the default code. Regarding the LEDs, they should be blinking when receiving data.

On Wed, 20 Oct 2021, 20:52 DutchTrickle, @.***> wrote: https://www.amazon.nl/gp/product/B07DJ4TGY3/ Ie also noticed, that if i turn on the D1 mini, the red light on the transceiver turns off (it turns on again if i power off the D1). Is it supposed to be on or blinking when its receiving data? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHW4H343WORUWT75FG5POZDUH4MXLANCNFSM4XA7V5PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Hm, when i connect only the transceiver, the RX led is blinking. I believe this is to be expected. I can then connect the power to the ESP, this appears online. So far so good. When now i connect the RX and TX, the led goes out...
When i reset the esp, i see a small blip of the led, but thats it.
I don't know what could be wrong, its just 2 simple wires, all other elements on their own seem to be functioning.

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Oct 24, 2021 via email

@DutchTrickle
Copy link

DutchTrickle commented Oct 24, 2021

Maybe a silly suggestion but can you double check Rx and TX Vs the diagram? I am wondering if they are the wrong way round? As diagnostic steps, which LEDs blink when: 1. You connect the transceiver to the esp only? 2. You connect the transceiver to the spa only? 3. You connect the transceiver to both?

Not silly at all. I appreciate the help. I wondered this myself, so i've switched them round. But still nothing. I have tx > tx and rx > rx.
When i connect the transceiver to the esp only i see nothing. Only a tx blip when powering on or resetting the esp.
When the transceiver is connected to the SPA, rx is blinking.
When i connect both, i see nothing.
You would think my esp is not working, but i can connect to the webserver, and it connects to my mqtt broker (although no messages obviously).

I'm starting to wonder, could my A and B on the transceiver be backwards? The voltage levels were very clear, and i put the higher one on the B pin.

I also tried to connect to my pc using a usb to ttl adapter. Opened the serial monitor and set baudrate to 115200. But i don't see anything dome in. Should i? I do see (garbled) messages coming in when i connect it over usb directly.
Correction, this is working, When i now only connect the ESP to the transceiver i see the tx blink whenever the esp resets due to a lack of messages. About once every ~15 seconds.

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Oct 24, 2021 via email

@tonyfitzs
Copy link

tonyfitzs commented Oct 24, 2021 via email

@DutchTrickle
Copy link

Odd, worth swapping A&B - the worse that will happen is messages get scrambled on the channel and your display will moan. Any other differences in your hardware connection vs the diagram on Github?
[…]

I tried swapping them, but noting changed. AFAIK i have the exact same setup as is described. I'm using a nodemcu currently as my wemos gave up on me, but this should make any difference as far as i can tell. (am i right?).
One other odd thing is, i dont get any errors on my display (NO COMMS). no matter how i connect everything. Is there something im missing?

@EmmanuelLM
Copy link
Contributor

EmmanuelLM commented Oct 26, 2021 via email

@StevieWW
Copy link

StevieWW commented Apr 9, 2024

Make sure you use a tranceiver with a MAX13487 Chip and not just MAX485. This was my problem since it seems that the layout of the linked board has been changed in between.

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

8 participants