Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Local TCP
#1
Hi,

Is this feasible? I understand the the principle of TCP/IP is microsoft comms over the internet. I am hoping that there is a simple'ish way around.

Run a tcp/ip session within a network?

I have a very useful RF relay box, it has a TTL serial port (RS232) for configuration and ethernet or sim connection to remote server. It opens a session with the server, sends buffered payload of tag data (recieved via rf) in short hex strings, checks for messages, closes session. The server has to remember to close the session after too. It works very well as a private mini network.

Some applications, especially in other countries have no existing infrastructure so i want to build an offline version that can be solar powered and simply log the data through a decode/parsing routine. The pi sd can then be put in a samsung/other tablet and provide locations on a pre-downloaded map of the area, eg, gps locations of released animals for conservation.

I've been able to interrogate the modem using telit's AT cmd library and have been able to get a terminal on the pi (Serial to USB COM port) to output the tag ID and some signal strength data as it is sent. But, can't work offline as only works if there is data going through the GSM modem. Also, the extended packet data (the GPS locations) isn't available. So not an option at this stage.

Plan b is to run an internet of 2 devices, each with a separate tp link style usb router (hopefully low power with wan and lan) and external IP address. The relay box using ethernet opens a session with a tcp/ip handler running on the pi and, initially log all data, unparsed in a simple database. I can configure the dataserver address on the relay and assign a static IP address on both devices.

This may well be a hardware person oversimplifying networks and software. Python has been pretty versatile so far with libraries for anything (control of individual bits in i2c two way messaging most recently) so i thought i should ask. A crossover cable between relay and pi would be the best but i think that's maybe even more absurd.

Also, if the system is run within a conventional network (both devices connected to the LAN ports on the same router) you just get a load of 'hello' s.

Thanks for advice, can it be done?
Ben.
Reply
#2
What you are talking about is an LAN.
check this out: http://www.wikihow.com/Create-a-Local-Ar...work-(LAN)
Reply
#3
Thanks! LAN already tried, sadly. Maybe the comment about 'hello's not clear enough above. I can ping the unit locally but the packet data is lost. The relay box has only worked (including all encapsulated data) over TCP/IP to remote server.
Reply
#4
(Jun-14-2017, 09:29 PM)hackysack Wrote: I understand the the principle of TCP/IP is microsoft comms over the internet.

Well, not true. TCP/IP is an internet protocol, hence the 'IP', not a particular operating systems.

Quote: I can ping the unit locally but the packet data is lost.
If you are pinging the remote host and the data is lost, then the 'ping' is unsuccessful. Your description is tossing out a lot of terms, some relevant, some not and some ambiguous. For instance, when you say 'relay box', are you referring to a 'router'.

If I understand correctly, the setup is something like:

RF tagged critter ----> RF transceiver <----> Serial Modem <----> Raspberry Pi <----> Router <----> Internet <----> Server far far away

Note: The transceiver and modem can be one unit, depending on manufacturer.

Also bear in mind that TTL levels are 5Vdc for a '1' and '0' Vdc for a zero. The Raspberry Pi uses CMOS levels, which is 3.3 Vdc for a '1' and 0 Vdc for a '0'. Due to 'fudge' factors you may or may not be able to make a connection with the RF box from the Pi, but in all likely hood, you will overload the Pi when receiving the higher voltages from the RFbox.

If my little diagram is correct, you need to clarify which segment is failing, how it is failing and how Python fits in to the equation.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020