RFLink connected to Rasp GPIO instead of USB!!

About receivers, transmitters, transceivers, connections, antennas etc.

Moderators: Voyager, BertB, rtenklooster, Stuntteam

Post Reply
Message
Author
beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

RFLink connected to Rasp GPIO instead of USB!!

#1 Post by beou » 12 Nov 2016, 17:48

Hi to all here!!

I was wondering why someone must connect the RFLink (the Mega2560) via the USB to the Raspberry pi
and not using the Raspberry's GPIO's!!!
Is there any system restrictions?
I am thinking that it will be more practical to have a virtual serial interface between Rasp GPIO and Mega2560 pins!
That way a complete Rasp shield (including a Atmega2560 chip) and all nesessary Tranceivers will be possible.
Is that possible?

Thanks guys

costo
Normal user
Posts: 482
Joined: 21 Nov 2015, 15:03

Re: RFLink connected to Rasp GPIO instead of USB!!

#2 Post by costo » 13 Nov 2016, 11:21

you can try to connect any ATmega2560 hardware pin to any Raspberry gpio-pin.
I can guarantee you will blow up your raspberry.

(something with 5V and 3.3V logic)

beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

Re: RFLink connected to Rasp GPIO instead of USB!!

#3 Post by beou » 13 Nov 2016, 11:33

costo wrote:you can try to connect any ATmega2560 hardware pin to any Raspberry gpio-pin.
I can guarantee you will blow up your raspberry.

(something with 5V and 3.3V logic)

Using a level translator is obvious, it can be included on the shield PCB!!
Its not a big deal to use a translator for a virtual serial com

User avatar
Stuntteam
Site Beheer
Posts: 585
Joined: 27 Jan 2016, 16:46

Re: RFLink connected to Rasp GPIO instead of USB!!

#4 Post by Stuntteam » 13 Nov 2016, 12:57

When using a level shifter to compensate for the voltage differences (arduino uses 5 volts, Pi is not 5 volt tolerant), you can connect the Mega's TX0 and RX0 to a Pi's io pins.
You should then be able to do some virtual serial port software on the Pi and simulate the serial port.
I do not see the advantage over connecting rflink to the USB port.. if it is a matter of keeping the USB available for other things you could use a USB hub..
So maybe you should explain a bit better what advantage you see..

Note that some people also wondered why not install the rflink firmware (after code changes of course) directly on a Pi.. the answer is simple.
We make 1 solution that can be used with a Pi, a PC, a NAS or any other piece of hardware that runs your home automation software.
1 solution is easier to maintain and support, also when putting the code on a Pi people are forced to use a Pi which is more expensive than a 5 euro Mega.
Via Ser2Net on an ESP it is possible to use a Wifi solution of USB is not desired. The Ser2Net solution also connects to TX0/RX0.
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

enc
Normal user
Posts: 5
Joined: 08 Nov 2016, 21:27

Re: RFLink connected to Rasp GPIO instead of USB!!

#5 Post by enc » 13 Nov 2016, 15:28

Using RX/TX directly from MEGA is very useful. For example I'm using ESP8266 bridge to MQTT which is connected to TX/RX. MQTT fits better to my needs. Also I can put RFLink with bridge anywhere in my house, I'm not limited by location of server. I installed everything (ESP and radio modules) on MEGA universal PCB. https://github.com/enc-X/mqtt-rflink-bridge
I have to use level shifter, even simple resistor based divider is fine (only in direction MEGA TX -> ESP RX).

User avatar
Stuntteam
Site Beheer
Posts: 585
Joined: 27 Jan 2016, 16:46

Re: RFLink connected to Rasp GPIO instead of USB!!

#6 Post by Stuntteam » 13 Nov 2016, 16:54

Yes, for the ESp it makes sense..
But for the Pi I do not see that advantage.
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

Re: RFLink connected to Rasp GPIO instead of USB!!

#7 Post by beou » 14 Nov 2016, 14:22

Thanks for your replies folks!


As the system currently is, you need a Rasp of course, an ATmega2560 board (Arduino) and the RFLink gateway board (in case you do not wish to use your own tranceiving hardware) plugged on the Arduino.
So you are ending having a Rasp and an Arduino board next to it connected via a short USB cable!

Are we ok so far?

My thought is: We can eliminate the extra Arduino board next to the Rasp by simply intergrate the ATmega2560 Arduino stuff with the RFlink gateway board hardware together and simply stack it as a shield to the Rasp. For convinience the serial communication of the Rasp to the ATmega of the shield should be done using the already available Rasp GPIO's! Surely you dont want to have a stacked Rasp shield and route a short usb wire back to the Rasp USB ports!
I am thinking thit as a "complete" smart home gateway controller

That's all!!!!!!

Am i clear now?

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: RFLink connected to Rasp GPIO instead of USB!!

#8 Post by NietGiftig » 14 Nov 2016, 17:26

beou wrote: My thought is: We can eliminate the extra Arduino board next to the Rasp by simply intergrate the ATmega2560 Arduino stuff with the RFlink gateway board hardware together and simply stack it as a shield to the Rasp. For convinience the serial communication of the Rasp to the ATmega of the shield should be done using the already available Rasp GPIO's! Surely you dont want to have a stacked Rasp shield and route a short usb wire back to the Rasp USB ports!
I am thinking thit as a "complete" smart home gateway controller

That's all!!!!!!

Am i clear now?
Yes very clear!
I cannot wait until you have made this new board and published it.
Until then I use the normal RFLink with arduino, cheap enough, then design another "universal" board.

Question, who is "we" in the sentence "We can eliminate the extra Arduino board"

User avatar
Stuntteam
Site Beheer
Posts: 585
Joined: 27 Jan 2016, 16:46

Re: RFLink connected to Rasp GPIO instead of USB!!

#9 Post by Stuntteam » 14 Nov 2016, 19:36

beou wrote:My thought is: We can eliminate the extra Arduino board next to the Rasp by simply intergrate the ATmega2560 Arduino stuff with the RFlink gateway board hardware together and simply stack it as a shield to the Rasp. For convinience the serial communication of the Rasp to the ATmega of the shield should be done using the already available Rasp GPIO's! Surely you dont want to have a stacked Rasp shield and route a short usb wire back to the Rasp USB ports!
I am thinking thit as a "complete" smart home gateway controller
Okay, so you make a shield that goes on top of the Pi and this shield has an Atmega..
that shield would then connect the Atmega's TX0/RX0 pins to Pi's GPIO pins.

Question: Can you make this shield for under 5 euro's? because that is the price of an Arduino Mega..

Who not go for:
You make a nice little box that is large enough to fit the two PCB's and put some proper metal RF shielding box surrounding the Pi, which is rather poor when it comes to RF noise!! inbetween and have yourself a 1 box home automation solution?
If you dont want to use a short USB cable you can connect the GPIO pins directly because that is already possible..

Or.. you can put the arduino with an ESP at some place central in your home.. and have the pi in a basement/cabinet/storage room/near your home router etc. and connect via wifi to the rflink..?

Or get an open source router install something like Domoticz on it and eliminate the Pi..
Or install Domoticz or similar on a NAS that serves your music/movies and not use a Pi..

There are many solutions and by having RFlink as it is now, with an option to use either USB or the serial pins, people can use it in all these scenarios while using some fancy Pi shield would mean extra costs to get that shield and people are forced to get a Pi..
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

Re: RFLink connected to Rasp GPIO instead of USB!!

#10 Post by beou » 16 Nov 2016, 15:49

Stuntteam wrote:
beou wrote:My thought is: We can eliminate the extra Arduino board next to the Rasp by simply intergrate the ATmega2560 Arduino stuff with the RFlink gateway board hardware together and simply stack it as a shield to the Rasp. For convinience the serial communication of the Rasp to the ATmega of the shield should be done using the already available Rasp GPIO's! Surely you dont want to have a stacked Rasp shield and route a short usb wire back to the Rasp USB ports!
I am thinking thit as a "complete" smart home gateway controller
Okay, so you make a shield that goes on top of the Pi and this shield has an Atmega..
that shield would then connect the Atmega's TX0/RX0 pins to Pi's GPIO pins.

Question: Can you make this shield for under 5 euro's? because that is the price of an Arduino Mega..

Who not go for:
You make a nice little box that is large enough to fit the two PCB's and put some proper metal RF shielding box surrounding the Pi, which is rather poor when it comes to RF noise!! inbetween and have yourself a 1 box home automation solution?
If you dont want to use a short USB cable you can connect the GPIO pins directly because that is already possible..

Or.. you can put the arduino with an ESP at some place central in your home.. and have the pi in a basement/cabinet/storage room/near your home router etc. and connect via wifi to the rflink..?

Or get an open source router install something like Domoticz on it and eliminate the Pi..
Or install Domoticz or similar on a NAS that serves your music/movies and not use a Pi..

There are many solutions and by having RFlink as it is now, with an option to use either USB or the serial pins, people can use it in all these scenarios while using some fancy Pi shield would mean extra costs to get that shield and people are forced to get a Pi..

NIce!! Thanks for your feedback Stuntteam!! About eliminating the USB cable and connecting the GPIO pins directly to the ATmega is there any directions of how to do it? Thanks!

User avatar
Stuntteam
Site Beheer
Posts: 585
Joined: 27 Jan 2016, 16:46

Re: RFLink connected to Rasp GPIO instead of USB!!

#11 Post by Stuntteam » 16 Nov 2016, 16:17

Arduino Mega Pin 0 (RX0) and 1 (TX0) are exactly the same in terms of signals as to what is available on the USB port.
The Arduino Mega pins are 5 volt. So you will need to convert at least the TX pin to 3.3 volt for the Pi.. otherwise you can harm the Pi.
No idea what software you will need on the Pi or what GPIO pins you need to use on the Pi.
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

Re: RFLink connected to Rasp GPIO instead of USB!!

#12 Post by beou » 16 Nov 2016, 16:42

Stuntteam wrote:Arduino Mega Pin 0 (RX0) and 1 (TX0) are exactly the same in terms of signals as to what is available on the USB port.
The Arduino Mega pins are 5 volt. So you will need to convert at least the TX pin to 3.3 volt for the Pi.. otherwise you can harm the Pi.
No idea what software you will need on the Pi or what GPIO pins you need to use on the Pi.


I don't care about hardware! I can easilly deal with it!
The issue here is the sofware part!
And like you... I have no idea about the mods in software needed!

Thanks again!

User avatar
Stuntteam
Site Beheer
Posts: 585
Joined: 27 Jan 2016, 16:46

Re: RFLink connected to Rasp GPIO instead of USB!!

#13 Post by Stuntteam » 16 Nov 2016, 17:10

From the Arduino/RFlink side there are no modifications needed in the software.

You will need to install some serial port software on the Pi.
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

Justblair
Normal user
Posts: 63
Joined: 08 Aug 2016, 23:42

Re: RFLink connected to Rasp GPIO instead of USB!!

#14 Post by Justblair » 16 Nov 2016, 18:03

The tx/rx pins on raspi are a hardware serial port. You can talk to it directly on ttyAMA0 if I remember correctly. I don't think you need special software.

beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

Re: RFLink connected to Rasp GPIO instead of USB!!

#15 Post by beou » 16 Nov 2016, 20:59

Justblair wrote:The tx/rx pins on raspi are a hardware serial port. You can talk to it directly on ttyAMA0 if I remember correctly. I don't think you need special software.

Hello Justblair!!

That's interesting indeed!! Is there any project that uses the Rasp TX/RX pins instead of the USB?

Tkanks for your reply!!

Justblair
Normal user
Posts: 63
Joined: 08 Aug 2016, 23:42

Re: RFLink connected to Rasp GPIO instead of USB!!

#16 Post by Justblair » 17 Nov 2016, 00:37

You mean home automation project?

I use openhab and am pretty confident that you can talk to ttyAMA0 using the serial binding.. I dont know how the other home auto softwares work. but it seems likely they can too.

beou
Normal user
Posts: 8
Joined: 12 Nov 2016, 17:34

Re: RFLink connected to Rasp GPIO instead of USB!!

#17 Post by beou » 17 Nov 2016, 20:40

HI all!!

Finally i managed to get rid of the USB cable!!

Thanks to Justblair (thanks a lot Justblair)!
And all the others of course.

No extra software is needed!!!!

All you have to do is to disable the serial console and take yourself the control of the serial port dev/ttyAMA0

(You can use minicom if you need to see the RFLink messages.)
Next, go to domoticz :
-Settings
-Hardware
-Select RFLink gateway USB
-Go to serial port field
-Select /dev/ttyAMA0 instead of /dev/ttyAMC0
-Press update
-Thats all!!!!

Now the Arduino mega is connected to the Rasp without USB but with two wires TX/RX.
(don't forget the voltage levels) use a voltage divider or a transistor

Is now time to design an (all in one) RFLink Rasp shield

Thanks

kimot
Normal user
Posts: 70
Joined: 12 Oct 2017, 20:46

Re: RFLink connected to Rasp GPIO instead of USB!!

#18 Post by kimot » 19 Nov 2017, 19:18

I think, that autor wants replace hole Arduino Meg, not connect it through serial port on GPIO.

If you want connect 433Mhz receiver and transmitter pins directly to Rasp PI gpio pins - yes, it is possible.
RfLink sw runs on Rasp pi intead of Arduino then. No Arduino nedded.

Github:
https://github.com/seahu/rflink

Install info ( only czech language ):§
http://seahu.webnode.cz/l/dokoncna-portace-rflink-u/

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest