RS485 Gateway with Nano and ENC28J60



  • Hello community.

    I wanted to build a Gateway with a Nano, a Max485 module and a ENC28J60 network module.
    I tried the ENC28J60 Gateway sketch with the changes to the rs485 transport, but there is a problem
    If i start the gateway it looks ok, if i start a node (connected through rs485 to my controller) it seems, that the nano reboots everytime if a message is received. I can't connect to the gateway with the "mysController".

    I think there is a problem with UIPEthernet and altsoftserial. Maybe someone have a idea to solve that?
    UIPEthernet uses pin 10. Altsoftserial uses the same timer for this pin (so pwm is not possible on pin 10). Maybe this is the problem?

    Hope you can help me.

    Thank you

    Best regards



  • @hausinger
    Maybe you are using an inappropriate "boards.txt" (i.e. Version > 1.6.11).

    Please check posts https://forum.mysensors.org/topic/5786/ethernet-gateway-no-lan-traffic-after-initial-controller-setup/2
    and/or
    https://forum.mysensors.org/topic/5716/solved-w5100-ethernet-gateway-with-nrf24-stable-mysensors-2-1-0-problem/4

    for "repair" instructions.

    A "wrong" boards.txt (from Arduino 1.8.0) caused exactly the behavior mentioned above, so this incompatibility (it' probably not a real error) can be fixed with a boards.txt version prior to 1.6.11.

    Please keep in mind, every time you update your Arduino IDE, this fix will be reverted.



  • @tboha
    Thank you for your fast answer. I tried do dowgngrade to board version v1.6.11, now i didn't have reboots on the gateway => Great 🙂

    But i still have a problem.

    I can't connect the MYSController with the gateway.

    My gateway fully start and write me the ip adress. If i connect a node through rs485 with it, i can see the messages in the serial monitor of the gateway. But if i want to connect the MYSController (on my windows pc) with the correct ip, i get this after some seconds (without output) : "Error on connect: connection refused"



  • @hausinger
    This does not resemble a MySensors message.
    I usually get this message when I'm stuck with my SSH connections on Raspberry Pi (lost SSH keys or such things) or due to bad setup - so denial of communication is correct but was not intended.
    I don't know if MySensors provides any security functions at this level, but if it does - switch 'em off.
    Perhaps you should try to ping your gateway. If there is an answer - i think the GW should be accessible. So it might be a configuration issue at MysController. But this is just a guess.

    I am using MyController (without "s"). Actually a ENC28J60 is connected, standard GW software from examples expanded by DHT11 and DS18B20.
    This configuration works well since about three months.



  • @hausinger
    Bad guess in above posting.

    I downloaded MysController (1.0.0beta:b3314:) - just for curiosity.
    Yes - I got the same error - connection refused with my ENC28J60GW, which was working fine with MyController just a few seconds ago.

    MysController is working fine with W5100 GW - without any configuration change (beside IP address).

    I will try some fiddling with MysController - but I am using this program for the first time today.

    Is there anybody out there successfully using MysController with ENC28J60 ?



  • @hausinger
    Yes, there is somebody - me.
    Just like magic - I switched back from my W5100 GW to ENC28J60 GW for testing purposes --- and it is working 😀 .
    Maybe because the node entries in the database were populated by the W5100 GW? I don't know.
    I have not changed anything within the GW software or hardware.
    So I still think it's a MysController setup issue. Maybe you will succeed using a serial GW for a short time to "initiate" MysController database and then switch to ENC28J60 GW ?? (I haven't tested adding new nodes...)



  • @tboha said in RS485 Gateway with Nano and ENC28J60:

    @hausinger
    Yes, there is somebody - me.
    Just like magic - I switched back from my W5100 GW to ENC28J60 GW for testing purposes --- and it is working 😀 .
    Maybe because the node entries in the database were populated by the W5100 GW? I don't know.
    I have not changed anything within the GW software or hardware.
    So I still think it's a MysController setup issue. Maybe you will succeed using a serial GW for a short time to "initiate" MysController database and then switch to ENC28J60 GW ?? (I haven't tested adding new nodes...)

    hi @tboha
    thank you for your testing and your answers here.
    I tried it with a serial gateway (it work in myscontroller). Then i tried it with the nano and enc28j60, but still "connection refused".
    Than i tried to build a orange pi gatway and i can connect it with myscontroller. so there is a problem on the nano + enc28j60 + rs485 (maybe altsoftserial??)

    I also tried the enc28j60 module with a simple hello world scetch to make sure that it is working fine. And yes, it worked. So the module is ok.

    I don't know, how to solve this problem



  • I'm also interested in Ethernet Gateway with RS485 transport.
    At the moment I have successfully tested this on Arduino UNO with 2 different Ethernet modules, W5100 and ENC28J60.
    In both cases I'm using hardware serial port on Arduino, not AltSoftSerial.

    // Enable this if RS485 is connected to a hardware serial port
    #define MY_RS485_HWSERIAL Serial
    

Log in to reply
 

Suggested Topics

2
Online

11.4k
Users

11.1k
Topics

112.7k
Posts