johnlauer/serial-port-json-server

udoo problem connecting json server to arduino-due

kendallgreen opened this issue · 3 comments

I still am having problems getting the serial-port-json-server to connect to the arduino-due on the UDOO board. The verbose output is listed here:
udooer@udoo:/etc/init.d$ sudo service serial-port-json-server start

  • Starting Serial Port JSON Server service /etc/init.d/serial-port-json-server: 23: /etc/init.d/serial-port-json-server: //: Permission denied
    [ OK ]
    udooer@udoo:/etc/init.d$ 2015/08/13 14:57:56 main.go:89: Version:1.83
    2015/08/13 14:57:56 main.go:96: Hostname: udoo
    2015/08/13 14:57:56 main.go:102: Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.
    2015/08/13 14:57:56 main.go:115: Starting server and websocket on 192.168.0.178:8989
    2015/08/13 14:57:56 main.go:118: The Serial Port JSON Server is now running.
    2015/08/13 14:57:56 main.go:119: If you are using ChiliPeppr, you may go back to it and connect to this server.
    2015/08/13 14:57:57 seriallist_linux.go:292: Rootpath:/sys, Numscanned:12466
    Matchedfiles:
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/manufacturer
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3/manufacturer
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/manufacturer
    2015/08/13 14:57:58 seriallist_linux.go:292: Rootpath:/sys, Numscanned:12466
    Matchedfiles:
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/product
    2015/08/13 14:57:58 seriallist_linux.go:118: The list of directories with serial port device data:[/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1 /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1 /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3]
    2015/08/13 14:57:58 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1
    2015/08/13 14:57:58 seriallist_linux.go:159: This is a hub, so skipping. /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1
    2015/08/13 14:57:58 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1
    2015/08/13 14:57:58 seriallist_linux.go:124: MOSART Semi. : 2.4G Keyboard Mouse () DevClass:00
    2015/08/13 14:57:58 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1, Numscanned:248
    Matcheddirs:
    2015/08/13 14:57:58 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:57:58 seriallist_linux.go:124: .
    2015/08/13 14:57:58 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id
    2015/08/13 14:57:58 seriallist_linux.go:124: Problem reading in manufacturer text file. It does not exist or Permissions maybe? err:open /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id/manufacturer: no such file or directory
    2015/08/13 14:57:58 seriallist_linux.go:124: : 4101 () DevClass:
    2015/08/13 14:57:58 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id, Numscanned:5
    Matcheddirs:
    2015/08/13 14:57:58 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:57:58 seriallist_linux.go:124: .
    2015/08/13 14:57:58 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id
    2015/08/13 14:57:58 seriallist_linux.go:124: Problem reading in manufacturer text file. It does not exist or Permissions maybe? err:open /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id/manufacturer: no such file or directory
    2015/08/13 14:57:58 seriallist_linux.go:124: : 4101 () DevClass:
    2015/08/13 14:57:58 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id, Numscanned:5
    Matcheddirs:
    2015/08/13 14:57:58 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:57:58 seriallist_linux.go:124: .
    2015/08/13 14:57:58 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3
    2015/08/13 14:57:58 seriallist_linux.go:124: Ralink : 802.11 n WLAN (1.0) DevClass:00
    2015/08/13 14:57:58 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3, Numscanned:342
    Matcheddirs:
    2015/08/13 14:57:58 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:57:58 seriallist_linux.go:124: .
    2015/08/13 14:57:58 seriallist_linux.go:124: Final port list: []
    2015/08/13 14:57:58 serial.go:119: Inside run of serialhub
    2015/08/13 14:57:59 main.go:144: Your serial ports:
    2015/08/13 14:57:59 main.go:146: There are no serial ports to list.
    2015/08/13 14:58:32 conn.go:42: Started a new websocket handler
    2015/08/13 14:58:32 hub.go:121: list
    2015/08/13 14:58:33 seriallist_linux.go:292: Rootpath:/sys, Numscanned:12466
    Matchedfiles:
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/manufacturer
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3/manufacturer
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/manufacturer
    2015/08/13 14:58:35 seriallist_linux.go:292: Rootpath:/sys, Numscanned:12466
    Matchedfiles:
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3/product
    /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/product
    2015/08/13 14:58:35 seriallist_linux.go:118: The list of directories with serial port device data:[/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1 /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1 /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3]
    2015/08/13 14:58:35 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1
    2015/08/13 14:58:35 seriallist_linux.go:159: This is a hub, so skipping. /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1
    2015/08/13 14:58:35 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1
    2015/08/13 14:58:35 seriallist_linux.go:124: MOSART Semi. : 2.4G Keyboard Mouse () DevClass:00
    2015/08/13 14:58:35 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1, Numscanned:248
    Matcheddirs:
    2015/08/13 14:58:35 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:58:35 seriallist_linux.go:124: .
    2015/08/13 14:58:35 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id
    2015/08/13 14:58:35 seriallist_linux.go:124: Problem reading in manufacturer text file. It does not exist or Permissions maybe? err:open /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id/manufacturer: no such file or directory
    2015/08/13 14:58:35 seriallist_linux.go:124: : 4101 () DevClass:
    2015/08/13 14:58:35 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:062A:4101.0001/input/input0/id, Numscanned:5
    Matcheddirs:
    2015/08/13 14:58:35 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:58:35 seriallist_linux.go:124: .
    2015/08/13 14:58:35 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id
    2015/08/13 14:58:35 seriallist_linux.go:124: Problem reading in manufacturer text file. It does not exist or Permissions maybe? err:open /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id/manufacturer: no such file or directory
    2015/08/13 14:58:35 seriallist_linux.go:124: : 4101 () DevClass:
    2015/08/13 14:58:35 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1/0003:062A:4101.0002/input/input1/id, Numscanned:5
    Matcheddirs:
    2015/08/13 14:58:35 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:58:35 seriallist_linux.go:124: .
    2015/08/13 14:58:35 seriallist_linux.go:131: Directory searching: /sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3
    2015/08/13 14:58:35 seriallist_linux.go:124: Ralink : 802.11 n WLAN (1.0) DevClass:00
    2015/08/13 14:58:35 seriallist_linux.go:309: Rootpath:/sys/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3, Numscanned:342
    Matcheddirs:
    2015/08/13 14:58:35 seriallist_linux.go:124: list of ports on this. map:map[]
    2015/08/13 14:58:35 seriallist_linux.go:124: .
    2015/08/13 14:58:35 seriallist_linux.go:124: Final port list: []
    2015/08/13 14:58:35 serial.go:460: Got metadata on ports:[]
    2015/08/13 14:58:35 serial.go:463: About to marshal the serial port list. spl:{[]}
    2015/08/13 14:59:17 hub.go:121: send /dev/ttymxc3 open /dev/ttymxc3 115200 tinygg2
    2015/08/13 14:59:17 serial.go:650: Inside spWrite arg: send /dev/ttymxc3 open /dev/ttymxc3 115200 tinygg2

2015/08/13 14:59:17 serial.go:576: Sending err back: We could not find the serial port /dev/ttymxc3 that you were trying to write to.

I send the command stty -F /dev/ttymxc3 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts in the serial-port-json-server script.

I wonder if the seriallist_linux.go would find the /dev/ttymxc3 port if it used getListViaTtyList() rather than getAllPortsViaManufacturer() in lines 25-26? Are there other changes that would be necessary if I compiled it changing those lines?

If you open a port directly with SPJS it should just open, regardless of whether it is in the port list that SPJS sends you. So the fact that it still doesn't seem to be able to open your port is a bad sign and seems more of an issue outside of SPJS. Are you able to connect to /dev/ttymxc3 from other apps successfully?

With respect to the port list, yes, you should try tweaking the code in seriallist_linux.go. It would be cool to try to fix getAllPortsViaManufacturer() to recognize your ports and then do a pull request because then it could benefit others. You could swap to getListViaTtyList() just to see if it helps, but you lose all the dual port detection of the TinyG G2.

I was able to upload tinygg2.bin to the Arduino on /dev/ttymxc3 using
bossac. Also I can see the initial code on loading Udoobuntu v2
(14.04) so I believe that the port works.

I compiled serial-port-json-server on my amd64 machine changing the
seriallist_llinux.go code at line 25-26 and it compiled fine and
listed my tty ports. I will try to compile it on the UDOO using dave
chaney's unofficial go for ARMv7 multiarch.

On 8/13/15, John Lauer notifications@github.com wrote:

If you open a port directly with SPJS it should just open, regardless of
whether it is in the port list that SPJS sends you. So the fact that it
still doesn't seem to be able to open your port is a bad sign and seems more
of an issue outside of SPJS. Are you able to connect to /dev/ttymxc3 from
other apps successfully?

With respect to the port list, yes, you should try tweaking the code in
seriallist_linux.go. It would be cool to try to fix
getAllPortsViaManufacturer() to recognize your ports and then do a pull
request because then it could benefit others. You could swap to
getListViaTtyList() just to see if it helps, but you lose all the dual port
detection of the TinyG G2.


Reply to this email directly or view it on GitHub:
#27 (comment)

Kendall B. Green DC70FEBB

With the compiled serial-port-json-server, I got the Chilipeppr logo simulation to run.
2015-08-13_39
It still says that there are no serial ports found on the json server