rvdbreemen / OTGW-firmware

A ESP8266 devkit firmware for the Nodoshop version of the Opentherm Gateway (OTGW)
MIT License
145 stars 34 forks source link

ESP8266 - PIC connection issue #65

Closed raf1000 closed 2 years ago

raf1000 commented 2 years ago

Hello

I have managed to compile files and uploaded ESP8266 using Arduino IDE.

I can login into otgw.local. When I click PIC firmware nothing is displayed, and info “ No version found” at the bottom When I click Device Info I can see data among which “Pic connected = false”

Hence I have uploaded PIC with getway.hex using otmonitor connected to OTGW gateway via FDDI/USB. I have performed TEST#1(diagnoze.hex) with 4 LEDs connected to the PIC and they are flashing. I do not have boiler nor thermostat so can not do more tests,

I can connect from otmonitor to OTGW gateway via FDDI and send a command like AA=70 , I can see response. However while otmonitor is connected to OTGW gateway via TCP/IP (port 25238), when send command AA=70, no response. Seems like ESP8266 is not connected with PIC☹. Any hints on how/what to check would be welcome. PS. I am able to connect to OTGW monitor via telnet as well but not sure what to debug?

rvdbreemen commented 2 years ago

Hi

You have already debugged a lot. It sounds like a connection problem.

What version of the pcb do you have? If it's a version 2.x then you have jumpers you need to set correctly so that the pic and the NodeMCU are connected.

Please let me know your findings,

Robert

raf1000 commented 2 years ago

The PCB V2.0. I have changed TxP/RxP jumpers for ESP/LAN as per instruction (so they are closer to ESP8266 Antena).The green LED (one of 4 LEDs connected to the PIC is flashing). I bought the gateway in April 2021 and now trying to make it running. I wanted to connect to Renovent Brink HR (Ventilation) which uses Opentherm protocol (I am in touch with a person who managed to do it). But I have the base issue with connection:-( . PCB looks OK not sure if it might be something on the board? if I can check any pcb connections? Or contact nodo shop for hints?

tjfsteele commented 2 years ago

That's very strange. What do you get when you connect to the NodeMCU via the web interface?

rvdbreemen commented 2 years ago

@raf1000 when you goto the debug port (telnet to 23) then you should see live messages being decoded, as well as some debug information like sending MQTT messages.

If you do not see anything there, then I agree with @tjfsteele it strange. The green led blinking from the PIC is what you expect. So if you do not see any commands being parsed, and the serial port OTmonitor port, does not respond either. That's why I suggested to check the jumpers, could you share a picture of how you have setup your jumpers at this point?

On the discord there are more people that could think along with you figuring out what the problem is.

And yes, if nothing else works, you can also just contact Nodoshop. He is always very helpful getting hardware running.

raf1000 commented 2 years ago

1) When using FDDI/USB, after clicking Gateway in otmanager, I have the following (green LED starts flashing): 18:34:24.936547 Command: PR=M 18:34:24.969383 PR: M=M 18:34:29.454368 Command: GW=1 18:34:29.471898 GW: 1 18:34:29.502723 R00000000 Read-Data Status (MsgID=0): 00000000 00000000

2) When using NodeMcu, after clicking Gateway in otmanager, I have the following (green LED starts flashing): 18:38:32.725177 Command: PR=M 18:38:35.403822 Command: GW=1

Should not be the same output for 1 and 2? In both cases I need change jumpers. Without changing jumpers the green LED does not flash.

When I log in to the otgw.local and click Device Info, I have the following: DeveloperRobert van den Breemen NodeMCU Firmware Version0.8.5+dc3dc14 (01-07-2021) OTGW PIC Firmware VersionNo version found Compiled on (date/time)Aug 13 2021 22:12:24 HostNameOTGW IP address192.XXX.X.XXX (correct IP address is here) MAC addressE8:DB:84:DD:17:FA Free Heap Memory (bytes)9472 Max. Free Memory (bytes)7096 Unique Chip IDdd17fa Arduino Core Version3.0.1 Espressif SDK Version2.2.2-dev(38a443e) CPU speed (MHz)160 Sketch Size (bytes)522.719 Free Sketch Space (bytes)1524 Flash ID001640D8 Flash Chip Size (MB)4 Real Flash Chip Size (MB)4 LittleFSsize2 Flash Chip Speed (MHz)40 Flash ModeDIO Board TypeESP8266_NODEMCU Wifi Network (SSID) (name of Wifi Network is here) Wifi Receive Power (dB)-73 NTP Enabletrue NTP TimezoneEurope/Amsterdam Uptime since boot0(d)-00:02(H:m) Last Reset ReasonExternal System Nr. Reboots54 MQTT Connectedfalse Thermostate connectedfalse Boiler connectedfalse Pic connectedfalse

raf1000 commented 2 years ago

Connected with telnet (I am not using MQTT here): help

---===[ Debug Help Menu ]===--- 1) Toggle verbose debug logging - OT message parsing 2) Toggle verbose debug logging - API handeling 3) Toggle verbose debug logging - MQTT module q) Force read settings m) Force MQTT discovery r) Reconnect wifi, telnet, otgwstream and mqtt

[19:04:51][ 11352| 9896] handleDebug ( 74): MyDEBUG =true [19:04:52][ 12856| 10544] do5minevent ( 167): Uptime seconds: 677

rvdbreemen commented 2 years ago

@raf1000 From the logs you have shared here I can say that there is no OT msg see at all.

Log 1&2 are the same, the status message is a fake decoding I think.

From the NodeMCU dev info I can see that the OTGW PIC does not see the boiler nor thermostat.

You could try to connect the wires again. Just to see if that makes any difference.

As far as I can see it's a "not connected" to the OT bus, you should see an average of 2 msg per second.

tjfsteele commented 2 years ago

The strange thing is that it seems to work when using the FTDI serial cable.

rvdbreemen commented 2 years ago

@tjfsteele it seems he can program the PIC, but I have not seen any data in either log from the boiler or thermostat. So either the jumpers are not connected correctly, or, the wires to the PCB from the boiler and thermostat are not connected correctly.

If both are good, then I am thinking a problem with this PCB all together.

What about you?

tjfsteele commented 2 years ago

In his original post he says

I do not have boiler nor thermostat so can not do more tests

Could be relevant?

Tim

raf1000 commented 2 years ago

Yes, at the moment I do not have connected boiler nor termostat. However my understanding of the gateway is that it shall resposne on the command I am sending, confirming that gateway received the request. Hence whileusing serial I have confirmation as follows: 18:34:24.936547 Command: PR=M 18:34:24.969383 PR: M=M 18:34:29.454368 Command: GW=1 18:34:29.471898 GW: 1

And when using NodeMCU there is no confirmation that Gateway received a command: 18:38:32.725177 Command: PR=M 18:38:35.403822 Command: GW=1

Also the information in the OTGW firmware: OTGW PIC Firmware VersionNo version found Pic connected false

led me to conclusion that there is no/full communication between PIC and NodeMcu. But there is "some" communication as the green LED start to flash in both cases when GW=1?

tjfsteele commented 2 years ago

The jumpers should look like this:

image

raf1000 commented 2 years ago

20210816_195645 Yes exacly, for NodeMCU I am changing jumpers as per my photo. When I use serial I need to change them agin

tjfsteele commented 2 years ago

I would disconnect the board from power then use a meter to check for continuity between the jumper caps and the vias as shown in the photo.

Also carefully inspect the solder joints around the jumpers and around the level converters at the top of the picture. Vias

Can you post a macro photo of your OTGW board underneath the NodeMCU (with the NodeMCU removed)?

rvdbreemen commented 2 years ago

"OTGW PIC Firmware VersionNo version found Pic connected false"

There is room for improvement in UI and software tests.

The firmware "no version" happens with some versions of firmware more often. I have found resetting it multiple times this sometimes resolves it.

The PIC connection false should be improved based on your feedback. It is used to let Home Assisant know about the status of the OTGW as a whole. So the name is deceptive.

Even when everything is offline you can still talk to the PIC. I think you describe the way to test it.

Using the REST API you can easily test the command sending. It even validates the return commands for you. Just check the wiki on how to use the REST API.

Sorry, for the confusion the UI causes.

raf1000 commented 2 years ago

When using power supplier I am not connecting to USB. I have checked RX between green circles and Tx between red circles and both are OK/continuity (0 ohm).
When I check between TxP and Tx on NodeMCu there is 22.8 kohm (probably some change of voltage on smd resistor?)

20210817_131420

tjfsteele commented 2 years ago

RxP and TxP are not directly connected to Rx and Tx on the NodeMCU, they go via level converters as the PIC works at 5V and the ESP works at 3.3V.

The photo you posted isn't very clear unfortunately when zoomed it, it's difficult to take a sharp macro photo so I don't blame you at all. As far as I can see there isn't a problem with the level converters which are the two transistors on the left.

I took a picture with my macro camera to show what it should look like. The transistor markings should all be the same.

Level Converters

The two transistors on the left are the level converters for the RX/TX lines. Each circuit consists of a BSS138 FET and 10K pull ups on the input and the output as described here https://cdn-shop.adafruit.com/datasheets/an97055.pdf.

raf1000 commented 2 years ago

The above was usuefull ! I was checking connection paths of NodeMcu Rx - TxP and NodeMcu Tx - RxP I can not check transistors (without soldering) but after checking all connections seems there is no connection between NodeMcu Rx and 10K resistor as on the picture below 20210817_174351

I could try to connect via cable but I have never soldered SMD (they are so small..) :-( I think I shall submit a complaint to nodo shop

rvdbreemen commented 2 years ago

Okay, so this has turned out to be a hardware issue.

Please do contact nodoshop. I will close the issue know, as it's not a software related issue 😉

Please let us know when it gets resolved by Nodoshop.

tjfsteele commented 2 years ago

IMG_20210817_171635.jpg

The pads marked in red should be connected together by tracks on the board.

Could the issue be the soldering of the NodeMCU socket?

raf1000 commented 2 years ago

Bingo! Thank you for indicating RXD on the PCB, this might be a workaround. As the RXD -R10 connection is OK, I can wire RXD with Node MCU Rx and it works! Regarding soldering I might have overhited but there is a connection from NodeMCU/top of the PCB to the bottom of PCB (where soldering looks ok, nothing strange) Again thank you for your help! Now I can see: OTGW PIC Firmware Version5.1 Pic connected true

tjfsteele commented 2 years ago

That's excellent news, thank you for letting me know!

rvdbreemen commented 2 years ago

Great news. Thanks @tjfsteele for helping out.

bmaehr commented 2 years ago

20210816_195645 Yes exacly, for NodeMCU I am changing jumpers as per my photo. When I use serial I need to change them agin

The jumpers set to FTDI have been the problem for my why I got "No version found" and also flashing the firmware didn't work. Please upgrade the documentation or better add a hint to the UI.

rvdbreemen commented 2 years ago

@tjfsteele do you think the documentation needs to be clearified?

bmaehr commented 2 years ago

@tjfsteele do you think the documentation needs to be clearified?

The problem is that a user like me (bougth the OTGW and the NodeMCU at nodo-shop) has to first find out what the real problem is.

With some searching after I got the packege today I found the wonderful landing page https://github.com/rvdbreemen/OTGW-firmware/wiki/ where all steps are described really well. Only the small step changing the jumpers on the OTGW is not there. And because the NodeMCU just shows "no verison found" I automatically expect, that the firmware on the OTGW is missing and not, that the communication with the OTGW was not working. So I was searching for instructions how to flash the firmware with NodeMCU (and tried the PIC firmware page without success).

rvdbreemen commented 2 years ago

@bmaehr that clarifies where additional hints can be added.

I think you just mean that when you get the message “no version found” there should be instructions to check the jumper setting.

To clarify one more thing: Did you use the install pdf from the nodo shop site at all?

tjfsteele commented 2 years ago

I'm wondering if this is a conflict between the v2.3 manual and an older board?

Hopefully the manuals in the shop will be labelled more clearly soon.

Tim

On Sat, 20 Nov 2021, 08:22 Robert van den Breemen, @.***> wrote:

@bmaehr https://github.com/bmaehr that clarifies where additional hints can be added.

I think you just mean that when you get the message “no version found” there should be instructions to check the jumper setting.

Did you use the install pdf from the nodo shop site at all?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rvdbreemen/OTGW-firmware/issues/65#issuecomment-974614976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CV4EG7GOEIEFWN2SRT7TUM5LFVANCNFSM5CGPDYAA .

bmaehr commented 2 years ago

I think you just mean that when you get the message “no version found” there should be instructions to check the jumper setting.

That is my suggestion.

To clarify one more thing: Did you use the install pdf from the nodo shop site at all?

In fact I did look at all documents from them (they where also hard to find, because on the english product page is no link to the download section for the manuals just links to other pages with other information and in the Netherlands version the link is called "construction manual") and not one was really helpfull.

I didn't need a document how to solder the board (didn't see there something about jumper either), I didn't have a Ethernet and didn't use a USB interface (even don't have a USB interface on the OTGW and didn't bought an Ethernet module) and additionaly the OTGW did look different than the one I got and also the NodeMCU look different and has an other name now (I have, as far as I can see, the versions form the picture above).

rvdbreemen commented 2 years ago

When I look at the picture you shared earlier, I think the issue is caused by the fact that we the manual at the nodoshop site is currently for PCB version 2.3. After talking to Tim (hardware designer of the current nodoshop PCB) we decided to publish the hardware manual for the older hardware. The jumpers are in the pre-v2.3 designs of the hardware.

We hope this solves the problem if anyone else encounters this, plus that the manuals stay available that way. Plus we have notificed Remco (owner of Nodoshop) about this. Asked him if he would be so kind to publish older versions of the manual, so people can find it when needed.

rvdbreemen commented 2 years ago

When I look at the picture you shared earlier, I think the issue is caused by the fact that we the manual at the nodoshop site is currently for PCB version 2.3. After talking to Tim (hardware designer of the current nodoshop PCB) we decided to publish the hardware manual for the older hardware. The jumpers are in the pre-v2.3 designs of the hardware.

We hope this solves the problem if anyone else encounters this, plus that the manuals stay available that way. Plus we have notificed Remco (owner of Nodoshop) about this. Asked him if he would be so kind to publish older versions of the manual, so people can find it when needed.

rvdbreemen commented 2 years ago

Closing issue, as the documentation is now published in Discord #Hardware channel. I am considering adding additional hint in the wiki as well.