Mac SPJS instability: Please help Hello folks,

Mac SPJS instability: Please help

Hello folks,
I’m new to this so bare with me, but I’m not all thumbs when it comes to computers having been a network administrator years ago. I’m having JSON disconnect issues as well, but am able to connect to the Arduino Uno and all looks good, then the JSON server appears to close down… Let me give some hardware details to set the stage:
Macbook Pro (early 2011 w/16GB RAM), SSD, connected to clone Arduino Uno R3 which has been flashed with latest GRBL hex. I’m in the process of building my own CNC router for the first time and while I’m waiting for parts, I thought I would get the brain part setup.
Software: Sierra 10.12.4 (latest)
Installed: XCode, Python, Arduino software, Fusion 360, etc. I also did the Homebrew install of all the goodies that come to support bCNC.Using SPJS v1.80, seems to be the latest mac version?
As a side note, bCNC, which run under Python, is up and running and stable with my GRBL flashed Arduino Uno, so it seems that it’s not a hardware issue.
Here are some observations, which may shed some light:

  • I cannot launch SPJS from a terminal prompt (how do I upload images in here?)
  • The Arduino is connected directly to my usb port on the laptop. Nothing is attached to it (one step at a time)
  • Chrom will not display webGL (maybe latest update), Safari does. This disconnect happens in either browser in the same manner.
  • When connected, I can issue $$ gcode and the Arduino spits out the appropriate reply string.
  • When the SPJS dumps, this is what it says in Chilipepper GRBL window "serial port ajax connection closed. Ready state 3.
  • I can then re-run the serial-port-json-server file, which launches a new terminal window and executes a bunch of commands. Then I can reconnect to my Arduino in Chilipepper, but it disconnects again promptly. Usually within 30 seconds.
    Thoughts? I appreciate any help I can get. And John thank you so much for creating this software and I’ve learned so much from your videos.

Here is what shows up in terminal window after I connect to Arduino via Chilipepper GRBL, it seems to close itself down:
Last login: Sat Apr 15 11:26:32 on console
You have new mail.
Tylers-MacBook-Pro:~ tylercartner$ /Users/tylercartner/Downloads/1\ HARDWARE/Arduino/serial-port-json-server_1.86_darwin_amd64/serial-port-json-server ; exit;
2017/04/15 12:07:53 main.go:89: Version:1.86
2017/04/15 12:07:53 main.go:96: Hostname: Tylers-MacBook-Pro.local
2017/04/15 12:07:53 main.go:102: Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.
2017/04/15 12:07:53 main.go:115: Starting server and websocket on
2017/04/15 12:07:53 main.go:118: The Serial Port JSON Server is now running.
2017/04/15 12:07:53 main.go:119: If you are using ChiliPeppr, you may go back to it and connect to this server.
2017/04/15 12:07:53 main.go:129: You can enter verbose mode to see all logging by starting with the -v command line switch.
2017/04/15 12:07:54 main.go:144: Your serial ports:
2017/04/15 12:07:54 main.go:151: {/dev/cu.Bluetooth-Incoming-Port cu.Bluetooth-Incoming-Port [] }
2017/04/15 12:07:54 main.go:151: {/dev/cu.usbmodemFA131 cu.usbmodemFA131 [] }
2017/04/15 12:07:54 main.go:151: {/dev/tty.Bluetooth-Incoming-Port tty.Bluetooth-Incoming-Port [] }
2017/04/15 12:07:54 main.go:151: {/dev/tty.usbmodemFA131 tty.usbmodemFA131 [] }
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x25b59a90672 pc=0x4108520]

goroutine 13 [running]:
runtime.throw(0x45515e0, 0x2a)
/usr/local/go/src/runtime/panic.go:527 +0x90 fp=0xc8205153e8 sp=0xc8205153d0
/usr/local/go/src/runtime/sigpanic_unix.go:12 +0x5a fp=0xc820515438 sp=0xc8205153e8
sync.(*Pool).Get(0x46fba20, 0x0, 0x0)
/usr/local/go/src/sync/pool.go:101 +0x40 fp=0xc820515488 sp=0xc820515438
/usr/local/go/src/fmt/print.go:133 +0x27 fp=0xc8205154c8 sp=0xc820515488
fmt.Sprintf(0x44d5310, 0xc, 0xc820515658, 0x1, 0x1, 0x0, 0x0)
/usr/local/go/src/fmt/print.go:202 +0x2b fp=0xc820515518 sp=0xc8205154c8
log.Printf(0x44d5310, 0xc, 0xc820515658, 0x1, 0x1)
/usr/local/go/src/log/log.go:289 +0x49 fp=0xc820515568 sp=0xc820515518
main.(*BufferflowGrbl).OnIncomingData(0xc82040c000, 0xc8203142d0, 0x26)
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:114 +0x32c fp=0xc820515910 sp=0xc820515568
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serialport.go:142 +0x3ec fp=0xc820515ca0 sp=0xc820515910
main.spHandlerOpen(0xc8200158f5, 0x16, 0x1c200, 0xc820015913, 0x4, 0xc820015900)
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serialport.go:499 +0xc68 fp=0xc820515f60 sp=0xc820515ca0
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc820515f68 sp=0xc820515f60
created by main.checkCmd
/Users/alden/Projects/proj82_go/src/serial-port-json-server/hub.go:162 +0x670

goroutine 1 [IO wait]:
net.runtime_pollWait(0x4faa110, 0x72, 0xc82000a160)
/usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8204a86f0, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8204a86f0, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0xc8204a8690, 0x0, 0x4faa208, 0xc820311ac0)
/usr/local/go/src/net/fd_unix.go:408 +0x27c
net.(*TCPListener).AcceptTCP(0xc8203082c8, 0x40a1be0, 0x0, 0x0)
/usr/local/go/src/net/tcpsock_posix.go:254 +0x4d
net/http.tcpKeepAliveListener.Accept(0xc8203082c8, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:2135 +0x41
net/http.(*Server).Serve(0xc82030aea0, 0x4faa1d0, 0xc8203082c8, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:1887 +0xb3
net/http.(*Server).ListenAndServe(0xc82030aea0, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:1877 +0x136
net/http.ListenAndServe(0x44c7118, 0x5, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:1967 +0x8f
/Users/alden/Projects/proj82_go/src/serial-port-json-server/main.go:169 +0xd26

goroutine 17 [syscall, locked to thread]:
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 11 [IO wait]:
net.runtime_pollWait(0x4faa050, 0x72, 0xc82000a160)
/usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8204a8760, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8204a8760, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8204a8700, 0xc82009e400, 0x400, 0x400, 0x0, 0x4fa0050, 0xc82000a160)
/usr/local/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc8203082d0, 0xc82009e400, 0x400, 0x400, 0x0, 0x0, 0x0)
/usr/local/go/src/net/net.go:172 +0xe4
/usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Read(0xc82030af60, 0xc8202f0040, 0x2, 0x8, 0xc82030e000, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:207 +0x260*Conn).readFull(0xc8202b4000, 0xc8202f0040, 0x2, 0x8, 0x0, 0x0)
/Users/alden/Projects/proj82_go/src/ +0xa9*Conn).advanceFrame(0xc8202b4000, 0x0, 0x0, 0x0)
/Users/alden/Projects/proj82_go/src/ +0x159*Conn).NextReader(0xc8202b4000, 0xc8202f0030, 0x0, 0x0, 0x0, 0x0)
/Users/alden/Projects/proj82_go/src/ +0x76*Conn).ReadMessage(0xc8202b4000, 0xc82000c4e0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/alden/Projects/proj82_go/src/ +0x55
/Users/alden/Projects/proj82_go/src/serial-port-json-server/conn.go:21 +0x2b
main.wsHandler(0x4faa3b0, 0xc8202ac0b0, 0xc8202e7260)
/Users/alden/Projects/proj82_go/src/serial-port-json-server/conn.go:55 +0x2fc
net/http.HandlerFunc.ServeHTTP(0x458dda8, 0x4faa3b0, 0xc8202ac0b0, 0xc8202e7260)
/usr/local/go/src/net/http/server.go:1422 +0x3a
net/http.(*ServeMux).ServeHTTP(0xc820014930, 0x4faa3b0, 0xc8202ac0b0, 0xc8202e7260)
/usr/local/go/src/net/http/server.go:1699 +0x17d
net/http.serverHandler.ServeHTTP(0xc82030aea0, 0x4faa3b0, 0xc8202ac0b0, 0xc8202e7260)
/usr/local/go/src/net/http/server.go:1862 +0x19e
/usr/local/go/src/net/http/server.go:1361 +0xbee
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:1910 +0x3f6

goroutine 9 [select]:
/Users/alden/Projects/proj82_go/src/serial-port-json-server/hub.go:51 +0x7f7
created by main.main
/Users/alden/Projects/proj82_go/src/serial-port-json-server/main.go:161 +0xc90

goroutine 10 [select]:
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serial.go:130 +0xbff
created by main.main
/Users/alden/Projects/proj82_go/src/serial-port-json-server/main.go:163 +0xcb4

goroutine 12 [chan receive]:
/Users/alden/Projects/proj82_go/src/serial-port-json-server/conn.go:32 +0x60
created by main.wsHandler
/Users/alden/Projects/proj82_go/src/serial-port-json-server/conn.go:54 +0x2ee

goroutine 14 [chan send]:
main.(*BufferflowGrbl).SetPaused.func1(0xc82040c000, 0x1)
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:425 +0x45
created by main.(*BufferflowGrbl).SetPaused
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:429 +0x8f

goroutine 15 [select]:
main.(*BufferflowGrbl).rptQueryLoop.func1(0xc8200aa1c0, 0xc8204a8000, 0xc82040c000)
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:378 +0x64e
created by main.(*BufferflowGrbl).rptQueryLoop
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:397 +0xc2

goroutine 16 [chan receive]:
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serialport.go:228 +0xd2
created by main.spHandlerOpen
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serialport.go:496 +0xc38

goroutine 50 [chan receive]:
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serialport.go:263 +0xae
created by main.spHandlerOpen
/Users/alden/Projects/proj82_go/src/serial-port-json-server/serialport.go:498 +0xc5a

goroutine 51 [chan send]:
main.(*BufferflowGrbl).SetPaused.func1(0xc82040c000, 0x2)
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:425 +0x45
created by main.(*BufferflowGrbl).SetPaused
/Users/alden/Projects/proj82_go/src/serial-port-json-server/bufferflow_grbl.go:429 +0x8f
Saving session…
…copying shared history…
…saving history…truncating history files…

[Process completed]

It may be SPJS version you use see this fit hub thread on issue with Latest OSX and disconnect SPJS

Sweet! Don’t know how I missed that. Now am running 1.92 of SPJS and it seems stable, running a job now with no issues so far. Thank you so much for helping out!

You said you’re using 1.80 and that is ancient. 1.94 is latest. Check Github releases page.

If you’re up for compiling 1.94 on Mac and then sending to me I could include a binary for that as well. Go lang does the most amazing cross-compiling but it’s never able to create a Mac version due to Apple’s closed nature.

Ah yes, I was just told that from another lovely community member. Thanks! The main github page only shows 1.86 with a mac OSX build. Ug, the 1.94 actually says “Sierra.” Seems stable enough now. Of course now I have to learn more about gcode and exporting from Fusion 360 CAM to eliminate errors. So much to know. Thanks again John.

Hi John, I’d love to help out but don’t know how to do what you ask. If you send instructions I can do it or if you want to remote in? I take that you don’t have a mac?

I meant that 1.92 says “Sierra,” but I gather you figured that out.

1.92 has a 100% CPU consumption bug on some network setups so it’s a dangerous build.

There’s a video on youtube on how to build Serial Port JSON Server so you could watch that and then build. There’s also directions on Github in the Readme.

On your other question, there’s this video on Fusion 360 and ChiliPeppr

I’m more of a hardware person, not much programming/compiling experience.

Sweet! I’ll give a whack and let you know how I make out. If’ I’m successful how shall I send the file to you? And thanks for the Fusion 360 CAM vid.

jlauer12 at gmail

Great, installing Go now… stay tuned.