afric post at 2018-2-12 00:54:07

aisdispatcher orangepi zero

Edited by afric at 2018-2-12 04:47

Hi
i have an orangepi zero with Armbian_5.35_Orangepizero_Debian_jessie_default_3.4.113
and i try to install and run aisdispatcher as i make to my raspberry... but it is not working
i am newbie....:'(

the way i try is

wget http://aishub.net/downloads/aisdispatcher_arm_glibc.tar.gz
tar zxvf aisdispatcher_arm_glibc.tar.gz

i run after that
sudo aisdispatcher_arm_glibc/aisdispatcher -r -d /dev/ttyUSB0 -s 38400 -H 192.168.1.100:13000      (i have found the ttyUSB0with dmesg)

but i take

unable to execute aisdispatcher_arm_glibc/aisdispatcher: No such file or directory

(with "ls" i find both folder and file)



can anybody help me?

edit:
root@orangepizero:~/aisdispatcher_arm_glibc# ls
aisdispatcher
(i run)
root@orangepizero:~/aisdispatcher_arm_glibc# file *
(and i take)
Could not find the database of available applications, run update-command-not-found as root to fix this
file: command not found


i did this
root@orangepizero:~/aisdispatcher_arm_glibc# chmod +x aisdispatcher
root@orangepizero:~/aisdispatcher_arm_glibc# ls -l
total 868
-rwxrwxr-x 1 orangepi users 887323 Aug 162012 aisdispatcher

but still nothing

root@orangepizero:~/aisdispatcher_arm_glibc# ./aisdispatcher
-bash: ./aisdispatcher: No such file or directory
root@orangepizero:~/aisdispatcher_arm_glibc#

edit2:
i install python-serial with

sudo apt-get install python-serial python3-serial
sudo nano read_serial.py

#{
#!/usr/bin/env python
import time
import serial

ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate = 38400,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
counter=0


while 1:
x=ser.readline()
print x
#}
and when i run
sudo python read_serial.py

i take messages from serial






afric post at 2018-3-3 21:44:02

Edited by afric at 2018-3-3 21:53

Final i installpython

sudo apt-get install python-serial python3-serial
sudo nano read_serial.pyi write the script
#start read_serial.py script
#{
#!/usr/bin/env python
import time
import serial

ser = serial.Serial(
port='/dev/ttyS2',
baudrate = 38400,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
counter=0


while 1:
x=ser.readline()
print x
#}
#end read_serial.py scriptand i run
sudo python read_serial.pyto see if ti works
after that i write onether script (i find it ready)
sudo nano serial_to_udp.py
#start script
# Python script for serial to UDP communication
# Alex Olwal, 2012 03 24
# www.olwal.com
#

import serial
import sys

from socket import *

def send(msg, ip, port):
    socket(AF_INET,SOCK_DGRAM).sendto(msg, (ip, port))

baud_rate = 38400

if ( len(sys.argv) == 1 ):
      print "Serial-to-UDP utility | Alex Olwal, 2012, www.olwal.com"
      print "Syntax: " + sys.argv + " serial_port udp_ip(= 127.0.0.1) udp_port(= 5000)"
      print "Example: " + sys.argv + " COM20 127.0.0.1 5000"
      quit()

serial_port = sys.argv

if ( len(sys.argv) >= 3 ):
      udp_ip = sys.argv
else:
      udp_ip = "127.0.0.1"

if ( len(sys.argv) >= 4 ):
      udp_port = sys.argv
else:
      udp_port = "5000"
               
if ( len(sys.argv) >= 5):
      printing = 1
else:
                printing = 0

print "Reading from serial port: " + serial_port
print "Sending to " + udp_ip + ":" + udp_port

udp_port = int(udp_port)

s = serial.Serial( serial_port, baud_rate, timeout=1 )

while (1):
      line = s.readline()

      if (line != ''):
                        if (printing):
                                print line[:-1]
            
                        send( line, udp_ip, udp_port )

      else:
            if (printing):
                print "."

s.close()
#end scriptnow if you run sudo python serial_to_udp.py you will take
Serial-to-UDP utility | Alex Olwal, 2012, www.olwal.com
Syntax: serial_to_udp.py serial_port udp_ip(= 127.0.0.1) udp_port(= 5000)
Example: serial_to_udp.py COM20 127.0.0.1 5000so i run
python serial_to_udp.py/dev/ttyS2 192.168.1.100 13000 &and i take serial data from ttyS2 (i have a MAX3232 RS232 Serial Port To TTL ) and i sent it to my pc at port 13000







afric post at 2018-3-3 21:57:37

Now i want to start it on boot by put at /etc/rc.local

i run
sudo nano /etc/rc.local
and i write
python serial_to_udp.py/dev/ttyS2 192.168.1.100 13000 &
before the exit0 but it doesn't start after reboot...

when i run
sudo /etc/init.d/rc.local start
i take ok

can any body help me?

afric post at 2018-3-4 05:10:07

Edited by afric at 2018-3-4 05:16

no help!!!! :@:@:@:@:@:@
why i ask for help here? nobody knows?

i find solution alone....:curse::curse::curse::curse:

i create a script
sudo nano /etc/init.d/serial_to_udp.sh
#!/bin/sh
python serial_to_udp.py/dev/ttyS2 192.168.1.100 13000 &i make itexecutable with
sudo chmod +x /etc/init.d/serial_to_udp.shand after that i run
sudo update-rc.d serial_to_udp.sh defaultsand after that i modified again therc.local
sudo nano /etc/rc.locali write
/etc/init.d/serial_to_udp.sh
sh '/etc/init.d/serial_to_udp.sh'before exit0

sudo rebootand it worksssssssssss:):)
page: [1]
View full version: aisdispatcher orangepi zero