Author Topic: Working offline?  (Read 2939 times)

gspadari

  • Newbie
  • *
  • Posts: 16
Working offline?
« on: March 24, 2016, 01:30:25 pm »
Hi.
Just a question: Is it possible to program an Oak with some sketch and later run it in a network without Internet access? Or it should always be connected to Internet?
I see that if I turn it on and the Wifi is not available, the Oak goes into config mode. But if Wifi become available, the Oak remains in config mode and the only way to go into program mode is to reconfigure it with the "Oak WiFi Config" page or reprogramming it.
Thanks.
« Last Edit: March 24, 2016, 03:45:38 pm by gspadari »

nelsonsilvafilho

  • Newbie
  • *
  • Posts: 21
Re: Working offline?
« Reply #1 on: March 24, 2016, 04:28:17 pm »
Same here.

It is very inconvenient and if not fixed will make the OAK just a 5 minute toy to be forgotten in the parts bin...

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Working offline?
« Reply #2 on: March 24, 2016, 05:16:21 pm »
Indeed - Not good behavior - I have a unique blink sketch running fine in my office.

If I power it up and quickly close the door with it in my microwave - I can see it won't run blinking.  It does start when I remove it.

If I put it back in my microwave running it continues.

I put my phone in the microwave with it and the network scan found just my closest 5Ghz WiFi - but nothing from the OAK.

PeterF

  • Hero Member
  • *****
  • Posts: 883
Re: Working offline?
« Reply #3 on: March 24, 2016, 11:01:28 pm »
I raised this with Erik a few weeks ago, and in the new Version 1.0.1 that was released the other day, another variant has been added which if it works properly (I haven't used it yet!!!) will make it so you have to put the Oak into safe mode (P1 to GND) to reconfigure the Wifi. So that should help ;) It might be worth looking at some of the Wifi control functions as well to see if there is any way to override things like needing wireless at all - i.e. being able to run the Oak with wireless offline, so just a much faster Arduino ;)

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Working offline?
« Reply #4 on: March 24, 2016, 11:50:18 pm »
I saw the new 'Manual Config Only' versus 'Default' for Safe Mode - wasn't sure what that was about.

Having the device not start until it can see WiFi (and talk to Big Brother) is a killer.  For my intended use I was going to expect WiFi to be 'Off and On' and deal with that in the code - either when I want to save power - or if WiFi just isn't online when I wake from sleep or whatever.

The device should get into loop() with or without WiFi online.  It can get there now and lose WiFi and then keep running - so not having WiFi should not prevent it from running.  How do we do that - and then have WiFi come online when it can?

emardee

  • Full Member
  • ***
  • Posts: 136
Re: Working offline?
« Reply #5 on: March 25, 2016, 12:34:24 am »
That is my desired outcome too...

I'd love to have the oak to be configurable to be able to start up from power on (with wifi off), and immediately run loop without looking for wifi at all. In my instance, I want to get first code run ASAP from power up. I can then hopefully initialise wifi as the second or third step (maybe calling that from the code?). Everything would be fine once it is running, but I don't want delays whilst waiting to find wifi.

I think 1.0.1 should be the first step towards that (and is great news for scenarios where we don't want acorn open wifi when router's wifi is off), but I suspect that we'd need some further changes in later firmware if our ultimate desires of being able to run with wifi off at startup.

For those wondering, here's the discussion about wifi config that lead to 1.0.1 changes:
https://github.com/digistump/OakCore/issues/18#issuecomment-200564522

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Working offline?
« Reply #6 on: March 25, 2016, 01:35:23 am »
Thanks for that link. Hopefully a graceful evolution is possible/planned - to always start in a finite time - and be ever watchful for specific networks without by default going into an open AP panic mode or requiring a reset to start working again.

I just tried my current ESP8266 mated to a Teensy and that software times out on power up in 20 seconds [ but I called for that after I was in setup() ] - then makes a "Soft AP" and stays that way, but in this case it is all Arduino code so I can modify that.

Nice Test: putting my cellphone with OTG adapter with a USB battery running terminal program to Teensy in the closed microwave watching the connected ESP drive the RGB LED. Microwave ovens do make a pretty good signal blocker - except my phone still saw 20% or 51% signal strength on my 5Ghz router.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Working offline?
« Reply #7 on: March 25, 2016, 10:28:05 pm »
The new variant combined with SYSTEM_MODE(SEMIAUTOMATIC) (see particle docs about that for now) allows you to achieve this - just make sure to test for a wifi connection and connect if there is one, otherwise you won't be able to update OTA when you want to - probably will take some more refinement (and could use a wiki entry) but it isnt forgotten

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Working offline?
« Reply #8 on: March 25, 2016, 11:08:15 pm »
Thanks Erik.