Hi guys, I'm desperately trying to install JSON Serial Port Server on my RPi,

gplus
(Erlend Steinsland) #1

Hi guys,

I’m desperately trying to install JSON Serial Port Server on my RPi, but since I am a newbie to RPi, I find it difficult.

I seem to remember there was a good how-to on this on the git page for the sw 1-2 years ago, but now I cannot find it.
Now I can only find a setup for the sever to start during boot.

Doe anyone have a good how-to on installing this?
PS: the more step by step and basic, the better.

BR
ES

(JOHN LAUER) #2

At it’s most basic, you just download the serial-port-json-server file from Github and run it from the command line.

There is a command line switch you can add that installs the startup script. Docs are in the Github readme on how to do that.

(Sebastian) #3
  1. Connect to your rPi with terminal console or via ssh.
  2. Download SPJS server: wget https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.95/serial-port-json-server-1.95_linux_arm.tar.gz
  3. Extract downloaded file: tar -xpzf /home/pi/Downloads/serial-port-json-server-1.95_linux_arm.tar.gz
  4. Copy SPJS server binary to /usr/bin/ (I don’t want to run it from Downloads folder and I want shorter file name): cp serial-port-json-server-1.95_linux_arm/serial-port-json-server /usr/bin/spjs195
  5. Edit /etc/rc.local file:
    vi /etc/rc.local or nano /etc/rc.local (depending what editor you use) and add a line inside the file, but before line exit 0:
    /usr/bin/spjs195
  6. Save the /etc/rc.local file:
    vi: press ESC, type :wq and press ENTER
    nano: press CTRL+X and Y to confirm
  7. Make sure /etc/rc.local has been updated:
    cat /etc/rc.local
  8. Reboot rPi:
    reboot

You’re done with all steps and SPJS will autostart everytime you power on rPi.

(JOHN LAUER) #4

Great write up @sszafran . In version 1.95 Added ability to run -createstartupscript on Linux to create an /etc/init.d launcher for auto-start of SPJS on boot