whitecatboard / whitecat-console

A command line tool for send and receive files to Lua RTOS compatible boards without an IDE
6 stars 8 forks source link

WCC not working on OSX Sierra #2

Open brainstorm opened 6 years ago

brainstorm commented 6 years ago

This is a followup on issue https://github.com/whitecatboard/Lua-RTOS-ESP32/issues/83#issuecomment-354528807. I just wanted to make sure that after a clean reboot and go build-ing the newest whitecat-console release I still have this problem:

brainstorm:whitecat-console romanvg$ ./wcc -p /dev/cu.usbserial-FTYKHBJT -f -ffs -d
2017/12/30 17:08:53 AppFolder:  /Users/romanvg/go/src/github.com/whitecatboard/whitecat-console
2017/12/30 17:08:53 AppFileName:  /Users/romanvg/go/src/github.com/whitecatboard/whitecat-console/wcc
2017/12/30 17:08:53 AppDataFolder:  /Users/romanvg/.wccagent
2017/12/30 17:08:53 AppDataTmpFolder:  /Users/romanvg/.wccagent/tmp
2017/12/30 17:08:53 connecting to board on /dev/cu.usbserial-FTYKHBJT ...
2017/12/30 17:08:53 attaching board ...
2017/12/30 17:08:53 detaching board ...
Can't connect to any board at port /dev/cu.usbserial-FTYKHBJT.

Available serial ports on your computer:

/dev/cu.usbserial-FTYKHBJT
/dev/cu.Bluetooth-Incoming-Port
/dev/cu.lpss-serial2

Adding a few more debugging hints in connection.go:

brainstorm:whitecat-console romanvg$ git diff
diff --git a/connection.go b/connection.go
index 4458912..a08e563 100755
--- a/connection.go
+++ b/connection.go
@@ -62,11 +62,14 @@ func connect(prerequisites bool, port string) {
                return
        }

+       fmt.Printf("INFO port status: %+v\n", info)
+       fmt.Printf("ERR  port status: %+v\n", err)

Yields the following:

brainstorm:whitecat-console romanvg$ ./build-osx && ./wcc -p /dev/cu.usbserial-FTYKHBJT -f -ffs -d
2017/12/30 17:34:45 AppFolder:  /Users/romanvg/go/src/github.com/whitecatboard/whitecat-console
2017/12/30 17:34:45 AppFileName:  /Users/romanvg/go/src/github.com/whitecatboard/whitecat-console/wcc
2017/12/30 17:34:45 AppDataFolder:  /Users/romanvg/.wccagent
2017/12/30 17:34:45 AppDataTmpFolder:  /Users/romanvg/.wccagent/tmp
2017/12/30 17:34:45 connecting to board on /dev/cu.usbserial-FTYKHBJT ...
INFO port status: &{p:0x47004b0 opened:false}
ERR  port status: <nil>
2017/12/30 17:34:45 attaching board ...
2017/12/30 17:34:45 detaching board ...
Can't connect to any board at port /dev/cu.usbserial-FTYKHBJT.

Available serial ports on your computer:

/dev/cu.usbserial-FTYKHBJT
/dev/cu.Bluetooth-Incoming-Port
/dev/cu.lpss-serial2

No idea why it is opened:false but still err reports nil :/

brainstorm commented 6 years ago

@jolivepetrus Jaume, em pots donar un cop de mà amb tot això? ;)

After updating the libserialport from sigrok into go-serial over here:

https://github.com/brainstorm/whitecat-console/commit/e21e357b5d72abbdfc419984c97fd9dda3ab904e

I've managed to get up to the point where the data shows up in the opened serial port and the notify reports some activity but the board ends up detaching anyway:

brainstorm:whitecat-console romanvg$ ./build-osx && ./wcc -p /dev/cu.usbserial-FTYKHBJT -f -ffs -d
2017/12/30 23:00:25 AppFolder:  /Users/romanvg/go/src/github.com/whitecatboard/whitecat-console
2017/12/30 23:00:25 AppFileName:  /Users/romanvg/go/src/github.com/whitecatboard/whitecat-console/wcc
2017/12/30 23:00:25 AppDataFolder:  /Users/romanvg/.wccagent
2017/12/30 23:00:25 AppDataTmpFolder:  /Users/romanvg/.wccagent/tmp
2017/12/30 23:00:25 connecting to board on /dev/cu.usbserial-FTYKHBJT ...
INFO port status: &{p:0x5100000 opened:false}
ERR  port status: <nil>
2017/12/30 23:00:25 attaching board ...
2017/12/30 23:00:25 ... to port:  /dev/cu.usbserial-FTYKHBJT
2017/12/30 23:00:25 THE ERROR ON OPENING SERIAL PORT IS:  <nil>
2017/12/30 23:00:25 start inspector ...
2017/12/30 23:00:26 waiting for ready ...
2017/12/30 23:00:28 XXX: DETECTED POWER ON RESET LINE!
2017/12/30 23:00:28 Line reads:  rst:0x1 (POWERON_RESET),boot:0x1 (ets Jun  8 2016 00:22:57
2017/12/30 23:00:28 XXX: DETECTED POWER ON RESET LINE!
2017/12/30 23:00:28 Line reads:  rst:0x1 (POWERON_RESET),boot:0x1 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_REO_V2))
2017/12/30 23:00:32 detaching board ...
Can't connect to any board at port /dev/cu.usbserial-FTYKHBJT.

Available serial ports on your computer:

/dev/cu.usbserial-FTYKHBJT
/dev/cu.lpss-serial2
/dev/cu.Bluetooth-Incoming-Port

Am I supposed to add some type of handler for boardPowerOnReset so that it can continue flashing Lua-RTOS?

Fins aviat, bon nadal i cap d'any!