Notes on manual install of ser2sock on Pi3

General Discussion

Notes on manual install of ser2sock on Pi3

Postby timlegge » Wed Apr 13, 2016 5:11 pm

Install latest raspbain jessie lite to your MicroSD as per the instructions on the Raspberry pi site:

Remap the pins to support serial console for ad2pi:

Code: Select all
scp timlegge@remoteserver:/pi3-miniuart-bt-overlay.dtb ./
sudo cp pi3-miniuart-bt-overlay.dtb /

sudo vi /boot/config.txt

add the following to the end of the file
dtoverlay=pi3-miniuart-bt-overlay
force_turbo=1


sudo nano /lib/systemd/system/hciuart.service
Replace ttyAMA0 with ttyS0


I admit it Unicode and languages confuse me:
Code: Select all
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales


Apply updates and install requirements:
Code: Select all
sudo apt-get update
sudo apt-get upgrade

sudo apt-get install libssl-dev telnet git


Clone the git repository and install:

Code: Select all
git clone https://github.com/nutechsoftware/ser2sock.git
cd ser2sock/
./configure
make
sudo cp ser2sock /usr/local/bin/
sudo cp -R etc/ser2sock /etc/
sudo cp init/ser2sock /etc/init.d/
sudo update-rc.d ser2sock defaults


Configure ser2sock to run as the pi user:
Code: Select all
sudo sed -i 's/^EXTRA_START_ARGS=.*$/EXTRA_START_ARGS=\"--chuid pi:dialout\"/g' /etc/init.d/ser2sock


Start daemon:
Code: Select all
sudo /etc/init.d/ser2sock start


Testing:
Verify that you can connect to the ad2pi:

Code: Select all
telnet 127.0.0.1 10000


Type a C and press enter <Enter>

You should see:
Code: Select all
!CONFIG>ADDRESS=18&CONFIGBITS=0109&LRR=N&EXP=NNNNN&REL=NNNN&MASK=ffffffff&DEDUPLICATE=N

In addition at this point you should see messages from the panel that look familiar like: ****DISARMED**** Ready to Arm "

Repeat for the hostname: telnet alarmdecoder.local and you should get the same results

Test sending data to the Panel:

Via telnet you should be able to send data to the panel. Using the number keys send the code to arm or disarm - You must send each digit one at a time by pressing the enter key after each digit.

Troubleshooting:

If you are unable to send data to the panel to arm or disarm you likely do not have the key pad address enabled (Ademco Vista). You can verify on the Vista 20P by using a working panel:

1) enter programming mode
2) For keypad address 18 enter: #191

The keypad should report '01' or above (ie. not '00' which is disabled) followed by two digits signifying the sound

Tim
Last edited by kevin on Wed Apr 13, 2016 5:42 pm, edited 1 time in total.
Reason: Sticky, change ser2conf to ser2sock in title
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Notes on manual install of ser2conf on Pi3

Postby kevin » Wed Apr 13, 2016 5:34 pm

Just a note on the telnet bit - you don't have to press enter after every character, just every command - alarmdecoder buffers strings just fine, so 41121<enter> would work just the same. That said, if you enter "mode char" into telnet, you won't have to hit enter at all.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 993
Joined: Fri Aug 16, 2013 10:10 am

Re: Notes on manual install of ser2conf on Pi3

Postby timlegge » Wed Apr 13, 2016 5:41 pm

kevin wrote:Just a note on the telnet bit - you don't have to press enter after every character, just every command - alarmdecoder buffers strings just fine, so 41121<enter> would work just the same. That said, if you enter "mode char" into telnet, you won't have to hit enter at all.


Nice, I meant to try that but assumed that it would not work. That is much better.
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Notes on manual install of ser2sock on Pi3

Postby David.B » Fri Dec 09, 2016 8:43 am

timlegge wrote:Install latest raspbain jessie lite to your MicroSD as per the instructions on the Raspberry pi site:

Remap the pins to support serial console for ad2pi:

Code: Select all
scp timlegge@remoteserver:/pi3-miniuart-bt-overlay.dtb ./
sudo cp pi3-miniuart-bt-overlay.dtb /

sudo vi /boot/config.txt

add the following to the end of the file
dtoverlay=pi3-miniuart-bt-overlay
force_turbo=1


sudo nano /lib/systemd/system/hciuart.service
Replace ttyAMA0 with ttyS0



This section of the instructions (quoted above) is deprecated. Offically released overlays that come with jessie-lite are mentioned below...

Raspbian Jessie->lite as of today...

If you don't care about Bluetooth just turn it off to fix the ttyAMA0 issue....

Code: Select all
edit /boot/config.txt  (use vi, nano...)
Add this line in:

dtoverlay=pi3-disable-bt

Disable HCI service:

systemctl disable hciuart


If you want to keep bluetooth...

Code: Select all
edit /boot/config.txt  (use vi, nano...)
Add this line in:
dtoverlay=pi3-miniuart-bt

edit: /lib/systemd/system/hciuart.service
Replace ttyAMA0 with ttyS0



Modify the kernel boot params

Code: Select all
Note these symbolic links...
lrwxrwxrwx 1 root root 7 Dec  9 08:50 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Dec  9 08:50 /dev/serial1 -> ttyS0

Edit: /boot/cmdline.txt
Either remove the console=serialX part or change it to point to ttyS0 or serial1



Reboot after making the changes.

When testing the AD2Pi be sure to use the command "minicom -D /dev/ttyAMA0 -b115200"

When in minicom hit "=" to reboot the board, it will flash lights very fast then output some text showing you it's working.

ctrl-a, then X, exit without reset
David.B
newt
newt
 
Posts: 11
Joined: Fri Dec 09, 2016 8:30 am

Re: Notes on manual install of ser2sock on Pi3

Postby timlegge » Wed Nov 15, 2017 4:22 pm

Thanks for the updates on the new overlays etc. I finally got around to updating sersock and raspbian
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Notes on manual install of ser2sock on Pi3

Postby wilsonb » Fri Nov 17, 2017 8:39 am

David.B wrote:
timlegge wrote:Install latest raspbain jessie lite to your MicroSD as per the instructions on the Raspberry pi site:

Remap the pins to support serial console for ad2pi:

Code: Select all
scp timlegge@remoteserver:/pi3-miniuart-bt-overlay.dtb ./
sudo cp pi3-miniuart-bt-overlay.dtb /

sudo vi /boot/config.txt

add the following to the end of the file
dtoverlay=pi3-miniuart-bt-overlay
force_turbo=1


sudo nano /lib/systemd/system/hciuart.service
Replace ttyAMA0 with ttyS0



I don't have this
"Replace ttyAMA0 with ttyS0"

in mine. This is mine from the latest alarmdecoder image on Raspberry Pi A+

----------------
Mine;

[Unit]
Description=Configure Bluetooth Modems connected by UART
ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins
Before=bluetooth.service
After=dev-serial1.device

[Service]
Type=forking
ExecStart=/usr/bin/btuart

[Install]
WantedBy=multi-user.target
wilsonb
Senior Nut
Senior Nut
 
Posts: 77
Joined: Sun Jul 26, 2015 4:14 pm

Re: Notes on manual install of ser2sock on Pi3

Postby timlegge » Fri Nov 17, 2017 6:49 pm

Mine too so I did not replace it in that file
timlegge
Junior Nut
Junior Nut
 
Posts: 31
Joined: Sat Apr 09, 2016 5:33 pm

Re: Notes on manual install of ser2sock on Pi3

Postby onlize » Sun Sep 23, 2018 7:08 pm

I wanted to follow this guide, but problems started right away. I installed Raspbian Stretch. When I try to run:

Code: Select all
scp timlegge@remoteserver:/pi3-miniuart-bt-overlay.dtb ./

it asks me about the password for timlegge@remoteserver. I am not sure what to do, but decided to change it to my user name and device name: pi@alarmdecoder. After I enter the password, I have this:

Code: Select all
pi@alarmdecoder:~$ scp pi@alarmdecoder:/pi3-miniuart-bt-overlay.dtb ./
pi@alarmdecoder's password:
scp: /pi3-miniuart-bt-overlay.dtb: No such file or directory
pi@alarmdecoder:~$ sudo cp pi3-miniuart-bt-overlay.dtb /
cp: cannot stat 'pi3-miniuart-bt-overlay.dtb': No such file or directory
pi@alarmdecoder:~$

What should I do?
Thank you.
onlize
newt
newt
 
Posts: 7
Joined: Thu Sep 13, 2018 3:51 pm


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests

cron