Author Topic: Oak CLI on ubuntu 14.04 [SOLVED]  (Read 8545 times)

bpr

  • Newbie
  • *
  • Posts: 4
Oak CLI on ubuntu 14.04 [SOLVED]
« on: January 23, 2016, 02:14:33 am »
I am able to claim and program OTA on Windows 10 just fine! Particle. publish runs great! However, I get a set of strange error messages on Ubuntu 14.04 when attempting to program:
module.js:341
    throw err;
    ^

Error: Cannot find module 'undefined\oak\config.json'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at nexe.js:33:90
    at Array.__dirname.call./home/james/Projects/oak/OakCLI/oak.js.fs (nexe.js:72:15)
    at initModule (nexe.js:31:11)
    at Array.forEach (native)
    at nexe.js:41:8
    at nexe.js:48:4
the selected serial port     at nexe.js:48:4
 does not exist or your board is not connected
« Last Edit: January 30, 2016, 01:06:10 pm by digistump »

kirby

  • Newbie
  • *
  • Posts: 19
Re: Oak CLI on ubuntu 14.04
« Reply #1 on: January 23, 2016, 01:57:08 pm »
Exact same thing on FC23. I am not sure that the firmware downloaded correctly. The only feedback I got was the speed that the LED blinks slowed down and became regular. When I power up the device using a battery, it joins the network and I can see 'Soft AP Setup' when I connect to the device. No matter what I do now 'oak' throws this error.

ajpowell

  • Newbie
  • *
  • Posts: 11
Re: Oak CLI on ubuntu 14.04
« Reply #2 on: January 23, 2016, 03:38:27 pm »
Hey bpr,

I'm seeing the 'undefined\oak\config.json' message on OSX too (see post http://digistump.com/board/index.php/topic,1951.0.html) - looks like it is due to the way the pathToConfig is constructed - it always seems to go for the win32 type path, even though APPDATA is not defined (see line 10 in oak.js in https://github.com/digistump/OakCLI) - in reply 4 I think I have a solution, but cannot compile it using nexe...this could well fix your problem too.

bpr

  • Newbie
  • *
  • Posts: 4
Re: Oak CLI on ubuntu 14.04
« Reply #3 on: January 23, 2016, 06:13:46 pm »
Thanks @ajpowell. But I can't get nexe to compile oak either. same error message

kirby

  • Newbie
  • *
  • Posts: 19
Re: Oak CLI on ubuntu 14.04
« Reply #4 on: January 25, 2016, 05:15:42 am »
A fresh cup of coffee and a Monday morning unsullied by work (yet!) helped.

Look in your home directory. See if there is a directory named 'undefined\oak\'. Also, check for a file named 'undefined\oak\config.json'. The following command fixed things for me.

mv undefined\\oak\\config.json undefined\\oak\\config.json

Auto-complete will help get the back-slashes right.

ajpowell

  • Newbie
  • *
  • Posts: 11
Re: Oak CLI on ubuntu 14.04
« Reply #5 on: January 25, 2016, 05:25:18 am »
Yes - that will work as long as you are using the copy of oak that the Arduino IDE is calling or you are calling oak manually.

djflix noticed that DarkLotus has since modified the source and recompiled - this version does appear to work (though I haven't got the code successfully loaded onto one of my Oak devices - see my post here: http://digistump.com/board/index.php/topic,1951.0.html) - the Mac OSX and Linux downloads are listed here:

Quote
Linux and osx copies of oakcli built with path fix can be found at https://github.com/digistump/OakCLI/pull/2

kirby

  • Newbie
  • *
  • Posts: 19
Re: Oak CLI on ubuntu 14.04
« Reply #6 on: January 25, 2016, 03:14:01 pm »
I downloaded the new oak from the url you gave(Thanks!). It seemed to work fine! I think I got particle.io to download one sketch to the board, at least the LED flashed really fast for a few systems. However, it seems to have bricked the board. No WiFi connection...
I am waiting to see what the new firmware does. I hope we get instructions for physical firmware upload.

aja175

  • Newbie
  • *
  • Posts: 19
Re: Oak CLI on ubuntu 14.04
« Reply #7 on: January 25, 2016, 06:17:25 pm »
@kirby was your board plugged into a a usb on your computer or external brick?

kirby

  • Newbie
  • *
  • Posts: 19
Re: Oak CLI on ubuntu 14.04
« Reply #8 on: January 26, 2016, 02:23:51 pm »
External supply.

kirby

  • Newbie
  • *
  • Posts: 19
Re: Oak CLI on ubuntu 14.04
« Reply #9 on: January 28, 2016, 06:32:44 am »
The stuff release this AM seems to have fixed things. I have just upgraded two boards and downloaded sketches to them. Now, I am off to do a serial recovery on the first board I tried. Well, I am off to work, after which I will attempt the serial recover.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Oak CLI on ubuntu 14.04
« Reply #10 on: January 30, 2016, 01:05:40 pm »
I'm marking this as solved, as the topic issue is solved by the latest release. Please feel free to continue this conversation if it is not.

Thanks,
Erik