Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. RS485 Gateway with Nano and ENC28J60

RS485 Gateway with Nano and ENC28J60

Scheduled Pinned Locked Moved Development
8 Posts 3 Posters 2.9k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hausinger
    wrote on last edited by
    #1

    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

    T 1 Reply Last reply
    0
    • H hausinger

      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

      T Offline
      T Offline
      tboha
      wrote on last edited by
      #2

      @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.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hausinger
        wrote on last edited by
        #3

        @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"

        T 3 Replies Last reply
        0
        • H hausinger

          @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"

          T Offline
          T Offline
          tboha
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • H hausinger

            @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"

            T Offline
            T Offline
            tboha
            wrote on last edited by
            #5

            @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 ?

            1 Reply Last reply
            0
            • H hausinger

              @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"

              T Offline
              T Offline
              tboha
              wrote on last edited by
              #6

              @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 :grinning: .
              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...)

              H 1 Reply Last reply
              0
              • T tboha

                @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 :grinning: .
                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...)

                H Offline
                H Offline
                hausinger
                wrote on last edited by
                #7

                @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 :grinning: .
                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

                1 Reply Last reply
                0
                • AndrewZA Offline
                  AndrewZA Offline
                  AndrewZ
                  wrote on last edited by AndrewZ
                  #8

                  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
                  
                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  22

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.0k

                  Posts


                  Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular