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

Nibepi with arduino nibegw #2

Open
veijavi opened this issue Jan 18, 2021 · 4 comments
Open

Nibepi with arduino nibegw #2

veijavi opened this issue Jan 18, 2021 · 4 comments

Comments

@veijavi
Copy link

veijavi commented Jan 18, 2021

Hi,

Thanx for the great piece of sotware! I'm using node-red-contrib-nibepi with Arduino nibegw for F1155-12. It seems that it's not working out of the box. I had to do the following modifications to get it working.

UDP ports
UDP ports are hard coded in nibepi. 9999 is for incoming data , 10000 is for read commands and 10001 is for write commands. By default nibegw-arduino uses 9999 for sending data and receiving read commands and 10001 for receiving write commands. So to get it working this have to be modified from code in nibegw or nibepi.

Read and wirte tokens
With raspberry nibegw version it seems to be possible to use "-i" parameter to send all data to nibepi including read and write tokens. Nibepi seems to require these to send any UDP messages out to nibegw. But arduino nibegw seems to send only the modbus data and there are no options to send read and write tokens to UDP. Off course the most elegant way would be to pass real received tokens to UDP, but because these tokens are always the same, I hard coded them and modified the code to send them to UDP every time the token is received from RS-485 side.

byte readToken[]={0x5C,0x00,0x20,0x69,0x00,0x49};
byte writeToken[]={0x5C,0x00,0x20,0x6B,0x00,0x4B};


    if (token == READ_TOKEN)
    {
      sendUdpPacket(readToken, 6);
      ....
     }
    
    else if (token == WRITE_TOKEN)
    {
      sendUdpPacket(writeToken, 6);
      ...
    }
@Tobi0610
Copy link

I can confirm that it is necessary to send these tokens. Otherwise NibePi is not sending any UDP messages/requests as described above.

Thank you!

@kirilldem
Copy link

I am also struggling to get nibepi write commands through my LilyGo nibegw device.

Do you know where I modify the token code?

@elupus
Copy link

elupus commented Dec 10, 2022

The esphome based gw already sends tokens.

@elupus
Copy link

elupus commented Dec 10, 2022

But, default on esphome-nibe is port 9999 for sending, 9999 for reads, 10000 for writes. This matches default on the arduino from openhab, but oddly not the raspberry pi variant.

So you need yo change to 9999, 10000, 10001

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

4 participants