User avatar
howroyd
Posts: 39
Joined: Thu Aug 02, 2012 1:41 pm
Location: Loughborough
Contact: Website

Installing ser2net from a tar.gz

Tue Apr 16, 2013 7:51 am

Hi all,

I am quite competent at installing stuff using apt-get, however the latest version of ser2net is not available in apt-get, and I require the functionality of the new release. (Ser2Net allows you to communicate with the raspPi UART over a network invisibly. I have mine connected to ArduPilot in a remote controlled plane, which pumps the controls & data down wifi using this package.)

So, I can download the tar.gz from http://sourceforge.net/projects/ser2net/files/.
I can unzip this; ./configure, make, make install. That is fine.

How do I get it to run on boot, like the older apt-get version? I have tried a few online guides but am failing miserably. If anyone is so kind as to do me a step-by-step for this I would be eternally grateful!

Cheers,

Simon

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Installing ser2net from a tar.gz

Tue Apr 16, 2013 8:54 am

Perhaps you need something like this?

http://www.stuffaboutcode.com/2012/06/r ... rt-up.html
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

User avatar
socialdefect
Posts: 110
Joined: Mon Jun 25, 2012 9:02 pm
Location: Tilburg, the Netherlands
Contact: Website

Re: Installing ser2net from a tar.gz

Tue Apr 16, 2013 10:31 am

Interesting... So you've made yourself a Raspberry-auto-Pilot ! That sounds like something I'd like to have too :o

If you need any help with the tutorial be sure to let us know but if you are a little familar with shell scripting you won't have any problems since it looks like a real proper howto to me.

If it doesn't work out you might also want to check-out pbuilder or something like it to help you build a proper Debian deb package which usualy also includes an init script. Also there exists an app that can auto-build an init script for you but I can't seem to remember it's name. It is present in the x86* repo's though....

good luck!
== If it's not broke... I'm not done fixing it! ==

User avatar
howroyd
Posts: 39
Joined: Thu Aug 02, 2012 1:41 pm
Location: Loughborough
Contact: Website

Re: Installing ser2net from a tar.gz

Tue Apr 16, 2013 2:11 pm

Cheers for the help all. Now got it working well, saving the serial stream to two log files, one for tx, the other rx. Sends over TCP so you can connect to the UART port over the network. The full setup code is below for anyone else wishing to do this.

Also, if anyone is interested in my project, some more info can be found here:
http://diydrones.com/profile/SimonHowroyd

Cheers

Simon

Code: Select all

%% INSTALL SER2NET FOR ARDUPILOT CONNECTION

cd /usr/local/bin/
sudo wget http://downloads.sourceforge.net/project/ser2net/ser2net/ser2net-2.8.tar.gz
sudo tar -zxvf ser2net-2.8.tar.gz
cd ser2net-2.8/
./configure
make
sudo make install
make clean
sudo cp ser2net.conf /etc/
sudo nano /etc/ser2net.conf

% change last lines to
BANNER:banner:\r\nraspPilot on  port \p device \d [\s] \r\n\r\n
2001:raw:600:/dev/ttyAMA0:115200 NONE 8DATABITS -RTSCTS banner

sudo update-rc.d ser2net-2.8 defaults

sudo /etc/init.d/ser2net-2.8 start

sudo nano /etc/inittab
% add hash to this line
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

sudo nano /boot/cmdline.txt
% delete references to ttyAMA0
% "console=ttyAMA0,115200 kgdboc=ttyAMA0,115200"

sudo reboot

Supermillhouse
Posts: 11
Joined: Sat Apr 13, 2013 10:12 am

Re: Installing ser2net from a tar.gz

Thu Apr 18, 2013 6:29 pm

The copy of ser2net that is on apt-get locks up my pi when it receives a connection. Has anybody else had this trouble, or am I doing something wrong???

User avatar
howroyd
Posts: 39
Joined: Thu Aug 02, 2012 1:41 pm
Location: Loughborough
Contact: Website

Re: Installing ser2net from a tar.gz

Thu Apr 18, 2013 8:46 pm

Yes, the copy of ser2net on apt-get is pretty old, version 2.6. Yoou can download the new one and make it yourself, which is version 2.8 and has full functionality. Although I did manage to get 2.6 working, here is the code for getting the new one which isn't on apt-get yet.

Code: Select all

cd /usr/local/bin/
sudo wget http://downloads.sourceforge.net/project/ser2net/ser2net/ser2net-2.8.tar.gz
sudo tar -zxvf ser2net-2.8.tar.gz
cd ser2net-2.8/
./configure
make
sudo make install
make clean
sudo cp ser2net.conf /etc/
sudo nano /etc/ser2net.conf

% change last lines to
BANNER:banner:\r\nraspPi on  port \p device \d [\s] \r\n\r\n
2001:raw:600:/dev/ttyAMA0:115200 NONE 8DATABITS -RTSCTS banner

sudo update-rc.d ser2net-2.8 defaults

sudo /etc/init.d/ser2net-2.8 start

sudo nano /etc/inittab
% add hash to this line
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

sudo nano /boot/cmdline.txt
% delete references to ttyAMA0
% "console=ttyAMA0,115200 kgdboc=ttyAMA0,115200"

sudo rm /usr/locl/bin/ser2net-2.8.tar.gz

sudo reboot

Supermillhouse
Posts: 11
Joined: Sat Apr 13, 2013 10:12 am

Re: Installing ser2net from a tar.gz

Thu Apr 18, 2013 9:19 pm

when I run this


sudo update-rc.d ser2net-2.8 defaults

I get this error

[email protected] /usr/local/bin/ser2net-2.8 $ sudo update-rc.d ser2net-2.8 defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/ser2net-2.8

I also have a copy of the apt-get version working on one sd card but cannot reproduce it

Supermillhouse
Posts: 11
Joined: Sat Apr 13, 2013 10:12 am

Re: Installing ser2net from a tar.gz

Thu Apr 18, 2013 10:04 pm

I got the ser2net to run but it still locks up the raspberry pi when I init a connection to my usb to ser port "ttyUSB0"
Are there some issues using a USB to serial converter, it's a bit odd how the first time I go to use it, it works flawlessly and now every other time I try to set it up it locks up the pi.
What can I be doing wrong, are there specific drivers I need, that I accidently downloaded previously?

Supermillhouse
Posts: 11
Joined: Sat Apr 13, 2013 10:12 am

Re: Installing ser2net from a tar.gz

Thu Apr 18, 2013 11:00 pm

got it working :D

Code: Select all

sudo apt-get install ca-certificates
sudo apt-get install git-core
sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
fixed it

User avatar
howroyd
Posts: 39
Joined: Thu Aug 02, 2012 1:41 pm
Location: Loughborough
Contact: Website

Re: Installing ser2net from a tar.gz

Fri Apr 19, 2013 2:04 pm

Good stuff.

Side note, anyone know a programme with similar functionality but with UDP rather then TCP? I keep getting comms losses with the plane, and it's a pain having to keep clicking reconnect when it comes back into range. UDP would solve this I think.

artemen
Posts: 1
Joined: Wed Jul 31, 2013 10:55 pm

Re: Installing ser2net from a tar.gz

Wed Jul 31, 2013 11:09 pm

hey everyone! I experience the same thing as supermillhouse when trying to run update-rc.d

[email protected] /usr/local/bin/ser2net-2.8 $ sudo update-rc.d ser2net-2.8 defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/ser2net-2.8

same thing happens with the 2.9.1 version my rpi is uptodate on the 31jul13....
creating an init.d script manually doesn't start ser2net...

@ supermillhouse could you describe the steps what did you do? unless it is the same thing as simon howroyd described as those result in the message i described earlier (ca certificates and git-core are of the latest version, rpi firmware just updated as well)

Return to “Beginners”