Hi all
I want to give feedback here.
Today i tried to build a orange pi gateway with a connected usb - rs485 converter on it. And what should I say - It worked without problems. Many thanks to you all
Great
Hi all
I want to give feedback here.
Today i tried to build a orange pi gateway with a connected usb - rs485 converter on it. And what should I say - It worked without problems. Many thanks to you all
Great
@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
@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"
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
@marceloaqno said:
@hausinger That shouldn't happen (gateway quitting itself). Could you submit the debug log with MY_DEBUG_VERBOSE_RF24 enabled?
Yes i can check that, but how?
I tried it to enable it in "example_linux" => mysgw.cpp (added the line "#define MY_DEBUG_VERBOSE_RF24")
I also tried it in the file: "MyConfig.h" (also added the line "#define MY_DEBUG_VERBOSE_RF24")
But my output is still the same in the console.
@jirm said:
Of course you dont need any SPI bus.
And so sorry but before I checked so badly the error you posted.Not seems any related working error for mysgw. I think you have mysgw working fine, seems only they can not connect/work with sensor node.
You seems only need check node communication and adjust node configuration to have your mysgw working.
I don't see you found so much trouble to make working from usb-rs485 adapter if you can do it with usb/serial node, it's only matter that the driver of adapter can work with mysgw without so much issues.
Regards
Thank you for your fast answer.
I try to answer it as best as I can.
I tried it once again:
connected the arduino to the USB port on my OPI
DMESG says it is port ttyUSB0
If i start the Gateway with:
sudo ./bin/mysgw -d
I got the same result as posted before. My CPU Usage is at 100% on one core.
if I kill the process of mysgw and start openhab2 (my used controller) it can connect direct to the Arduino (connected as USB as before) and it worked fine.
So my configuration of my nodes (currently only 1 for testing) is working fine through rs485.
Summary:
Connection node -> Arduino Gateway = OK
Connetion from openhab2 to Arduino Gateway = OK (openhab2 on same OPI as Arduino)
OPI as a Ethernet - Serial Gateway = NOT OK, Problem is shown on my screenshot.
USB-RS485:
I also tried this, but after my configuration:
./configure --my-gateway=ethernet --my-port=5003 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyUSB0 --my-rs485-baudrate=57600
I can do the "make" command.
After that I start it with:
sudo ./bin/mysgw -d
I only get this:
I can now type a new command in the console (Gateway quit itself)
@jirm said:
Hi again to all OPI users.
I like see that are great movements here.
I think main goal here is achieve that OPI board can run mysensors for herself connected radio boards.
Of course that can work OPI (or any board) if we attach over some port the radio board, because use of any "conventional" port (means usb, serial, eth) is the same for any hardware from the software view.Said this, I would simplificate (and reduce all hardware to minimum) all things I can and with a powerful board I can concentrate much of the roles needed.
Attach directly (means through GPIO) all hardware the board can manage without issues is my goal, and I think other much people.I think the error posted @hausinger for run mysgw seems derived from de main problem we see when try compile mysensors on OPI, and is that the need (maybe although not always necessary) that SPIDEV driver are up and working properly and mysensors software can not detect SPI bus (then fail SPIDEV) on OPI while is not being adapted all software stuff from some mysensor coder.
I hope some mysensors coder hear our call and soon can help here.
Regards
In my case, why should it be necessary to have a working spi bus? I wanted to connect a working arduino with the mysensors gw scetch on it throug USB to the OPI and use this as a ethernet gateway.
My last goal is to use a USB to RS485 converter on my OPI (works as a Gateway) without a connected arduino, because my whole mysensors communication should be over RS485.
@pansen said:
@hausinger: try to change
./configure --my-gateway=serial --my-serial-port=/dev/USB0 --my-serial-baudrate=115200
to
./configure --my-gateway=serial --my-serial-port=/dev/ttyUSB0 --my-serial-baudrate=115200Be aware that USB devices are enumerated in the order they have been plugged in, so you cannot rely 100% on the arduino being "0".
@mihai-aldea: haha I didn't even consider this. are there any disadvantages except for the increased power consumption? (and slightly higher cost)
ooh sorry. Sure, i wrote "ttyUSB0". It was a typing mistake here on the forum. In my configuration I already typed ttyUSB0
I edited my last post.
But the issue is still the same.
I'm using a orangepi one and with your help I can compile it.
I tried it with a serial gateway. I connected a arduino nano with the gateway serial scath on it through USB to my orangepi one. DMESG say to me, that it is attached to ttyUSB0
So i tried to build the gateway with:
./configure --my-gateway=serial --my-serial-port=/dev/ttyUSB0 --my-serial-baudrate=115200
make has no errors
after that, i tried to start it with:
sudo ./bin/mysgw -d
Is started but i get this problem:
(
Do you know whats wrong with it?
@aand said:
@hausinger -- are you running armbian on your orange pi one?
Yes, I'm running on armbian on my orange pi one
Hello.
I'm also using a orangepi one and wanted to build the gateway on it. But i didn't want to use the nrf24 but a usb to rs485 converter. But if i want to compile it, i get also the same error with the nrf24 and that it is not supporting platform. Why?
Also if i want to build a serial gateway with a connected arduino on usb port, i got the same error with the nrf24
@marceloaqno said:
@hausinger After the command:
sudo ./bin/mysgw -d
It wasn't supposed to go back to bash, the gateway would wait for new messages.
I'm not sure what's going on with your setup because I tested your configuration options here and it worked.
Thank you for your answer. What can I do now? Can I check, that this port is unused? And how can I check this?
Or is there another problem?
@hausinger said:
@marceloaqno said:
@hausinger You forgot "--" for my-rs485-baudrate=57600 in your configuration.
It should be:./configure --my-gateway=ethernet --my-port=5003 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyUSB0 --my-rs485-baudrate=57600
Hi @marceloaqno
Thank you for your answers. Yes, i saw this, but I did the "--", i forgot it in the last post, because I can't use copy & paste on my raspberry (remote Desktop).Did this configuration work on your System?
Are you sure, that my configuration is ok? (with the "--")
Whats the normal behavior when i start the mysGateway with debug (mysGateway -d)? If i type the starting command in the terminal, the Gateway gives me the Messages (from my last post) and thats it (not more). I can now type a new commandI'm now not at home (Business trip), if I get home, i will try your "Screen" command
So I'm at home today and make some Test.
The screen comand gives me some strange characters, thats ok I think.
But if i start the Gateway, I only get the same messages as shown in my other post.
Here are 2 Pics that show you, how it look like.
I also tried to make the gw with a baudrate of 9600, but still the same issues.!
@marceloaqno said:
@hausinger You forgot "--" for my-rs485-baudrate=57600 in your configuration.
It should be:./configure --my-gateway=ethernet --my-port=5003 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyUSB0 --my-rs485-baudrate=57600
Hi @marceloaqno
Thank you for your answers. Yes, i saw this, but I did the "--", i forgot it in the last post, because I can't use copy & paste on my raspberry (remote Desktop).
Did this configuration work on your System?
Are you sure, that my configuration is ok? (with the "--")
Whats the normal behavior when i start the mysGateway with debug (mysGateway -d)? If i type the starting command in the terminal, the Gateway gives me the Messages (from my last post) and thats it (not more). I can now type a new command
I'm now not at home (Business trip), if I get home, i will try your "Screen" command
@napo7 said:
@hausinger said:
My idea besides of that is, that nodes can work without the bus. For examble the push button Switch can Switch the light, even when the bus is down. With mysensors this is not possible, because nodes have to register to the Gateway. Mysensors should be a "add on" for the nodes in my home, to control all on one place - openhab.
The only way to handle this kind of problem, is to make device with INPUT and OUTPUT at the same time !
You would then have to think of an intelligent way of handling what happens when the INPUT see events :
Do you have to transmit it to the gateway, wait for a reply, and then fall back to a "fail" mode if the gateway doesn't reply after a delay ?
Do you prefer handling the event simply by turning ON/OFF the output, and just inform the gateway of what happening ? this way, even if the bus is down, your device will continue to work... but you're loosing the benefits of having an intelligent controller/gateway that can make decisions...
Hi @napo7
Yes, i would prefer handling it direct on the nodes. Not only ON/OFF, also dimmer (1 short press on the push button - Light on (last value) + turn on power supply of the lamps (Relais=1), 1 short press on the push button - light off + turn power supply off of the lamps (Relais=0), 1 Long press on the bush putton - dimming). The Gateway (and Controller) should be able to do the same Thing, if the bus is ok. But if it fials, i could use it localy and so i'm not in a dark room.
@marceloaqno said:
@hausinger Have you checked if /dev/ttyUSB0 is receiving any data?
Thank you for your answer. I don't know, how to check that? The wiring to my nodes is correct, the serial port is correct (dmesg says that).
Could you confirm, that my configuration from my last post is correct?
I wanted to use the mysGateway with a USB/RS485 converter.
Here is my config: ./configure --my-gateway=ethernet --my-port=5003 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyUSB0 my-rs485-baudrate=57600
make does it's job, but after i start the gateway it says:
mysGateway: Starting gateway....
mysGateway: Protocol version - 2.0.1-beta
mysGateway: MCO:BGN:INIT GW,CP=RSNG---,VER=2.0.1-beta
mysGateway: TSM:INIT
mysGateway: TSM:INIT:TSP OK
mysGateway: TSM:INIT: GW Mode
mysGateway: TSM:READY
after that it stopped to work.
Whats wrong in my configuration?
@kimot
thank you for your answers in this case.
You think, the SN65HVD230 is better than the max485? Can I use the SN65HVD230 with mysensors and Transport class rs485 without changes in the code? If yes, how do I do with the "DE-Pin" ?
I don't know, why you are using 3 Bus Systems at your home? Why not 1 Stable Bus?
I want a stable bus for several things in my new home. PIR, Standard button Switch, Contacts (Window, Smoke), Dimmers, RGB Dimmers, Temperaturesensors, Relays should be my nodes. The Problem in this case is, that I want to use my nodes even when the bus have Errors.
So if you seperate the communication from sensors to Gateway (with your self made library, as you wrote here) and the Gateway communication with the Controller with the mysensors libs, that would be excactly what I'm locking for.
My idea besides of that is, that nodes can work without the bus. For examble the push button Switch can Switch the light, even when the bus is down. With mysensors this is not possible, because nodes have to register to the Gateway. Mysensors should be a "add on" for the nodes in my home, to control all on one place - openhab.
I also want to have a stable bus, because it would be very bad, when i press a push button and nothing happens (=is dark in the room), because the bus is busy. Sure it doesn't matter if a temp sensor can't transmit it's value to the Controller. But for Switch / PIR it is very important.
And this is, what I'm wrote there:
I'm very interested in your development.
What kind of can bus module are you using? I found 2 different modules for very less money. The very small module is called SN65HVD230 (controlled by serial rx, tx) and cost approximately 1,75$ from China. The other module with bigger size is called MCP2515 (controlled by spi) and cost approximately 1,26 $ from China. Both are very cheap.
What is you currently status in this case?
I'm planning to use it for my new house in some month.
Thank you
@b0rmann
Do you still using the rs485 usb "dongle" to connect the rs485 nodes to the rpi? Do you attached some more nodes to your rs485 rpi Gateway?
Is it stable?
How do you do the configuration for it?
I'm very interested in your development.
What kind of can bus module are you using? I found 2 different modules for very less money. The very small module is called SN65HVD230 (controlled by serial rx, tx) and cost approximately 1,75$ from China. The other module with bigger size is called MCP2515 (controlled by spi) and cost approximately 1,26 $ from China. Both are very cheap.
What is you currently status in this case?
I'm planning to use it for my new house in some month.
Thank you
Hello community,
i have a small problem with openhab2 (on a orange pi with armbian - similar to raspberry) and mysensors Serial Gateway.
I installed openhab2 with the get methode and it works fine. I was able, to start it with openhab2.service (also automated) and openhab2 worked as it should. But if i want to connect the mysensors serial gateway to the orange pi with openhab2, openhab2 can't find my gateway. The log says "openhab is unable to connect to serial port, wrong serial port?"
But my serial port is ok.
If i stop openhab2.service and manual start openhab2, than all is fine, it can connect to serial gateway immediately and work fine. I don't know, why it can't work if openhab2 starts as service. Can you help me in this case?
Thank you.
And sorry for my english, it's not my first language
Sorry for my Late reply.
I had an issue with the max485 (ground problem) and the declaration of the node id (was at the wrong position in the sketch).
I think, it would be better, if this is also in the examples in the ms library.
It cost me some time to find this solution for the node id. But i wasn't sure, if it was the parent or node id
I solved the issue.
Could be closed.
Is it possible, to built a esp8266 wifi gateway and communicate GW to node with rs485?
In altsoft esp8266 is not decleared, so i can't use it out of the box.
Btw: I tested my_rs485 with nano as GW and Pro Mini as node, and it worked great. Thank you
Hello community
I want to use Mysensors in future to use it in my new house as a wired bus system.
So i tried it out today with a arduino nano and a arduino pro mini.
I downloaded the newest mysensors library in the Arduino IDE and upload the RS485 GW scatch to the nano and the rs485 PIR scetch to the arduino pro mini.
I also downloaded the MYSController App on Windows.
Than i tried to connect the 2 Arduinos to check, if it all running fine.
But in MYSController i can only see the GW.
First i was trying to use the max chips for the communication, but the GW does nothing.
So i tried to connect directly the Nano and the Pro mini, but the GW does always nothing.
The pins i used with the max chips is 8, 9, 2 on Nano and on Pro mini.
In direct connection i connected only 8 and 9. Both arduinos are on the same ground potentional.
I switched on then de debug in the node, here is the serial output:
TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
!TSM:FPAR:FAIL
!TSM:FAILURE
TSM:PDT
My GW Log is this:
0;255;3;0;9;Starting gateway (RSNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
0;255;3;0;14;Gateway startup complete.
0;255;0;0;18;2.0.0
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
0;255;3;0;5;1
Hope, somebody can help me?
Best regards