Author Topic: Programming without Particle?  (Read 2050 times)

jwschull

  • Newbie
  • *
  • Posts: 4
Programming without Particle?
« on: November 18, 2016, 09:42:09 am »
I absolutely do not like using the Particle domain to send programs to my OAK.  Overly complicated and error prone.
I only occasionally get the OAK to connect to the Particle server.  Running 192.168.0.1\particle == Not Connected
When verifying the program I get an error:  WiFi.begin(xxx,xxx); Error says I need to use OAK config to change networking.  What??  There is no WiFi.config command, at least not where I can find. 

Is there a way to cut Particle out of the equation and just use the USB interface?  Have the Oak's WiFi act more like an ESP8266?

 

jwschull

  • Newbie
  • *
  • Posts: 4
Re: Programming without Particle?
« Reply #1 on: November 18, 2016, 10:20:52 am »
Nevermind.  I found the data needed.  Now to reprogram all my OAKs.  Aghhhh... :-[

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Programming without Particle?
« Reply #2 on: November 18, 2016, 11:15:45 am »
Quote
Nevermind.  I found the data needed.

Can you share the data you found?

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Programming without Particle?
« Reply #3 on: November 18, 2016, 04:07:53 pm »
Regarding the WiFi.begin() / WiFi.config() commands, three things spring to mind:

1) You can't use the WiFi.begin() command like you can on the ESP8266 Arduino due to how the oak is configured with persistent wifi and is configured with the SoftAP page

2) There is a WiFi.config() command... it just doesn't do what you want (WiFi.config(ip, gateway, subnet);)!!

3) The wifi config spoken in the errror message when you tried to use WiFi.begin() about is actually the SoftAP configuration page - the Oak is programmed so that that the wifi config is managed by using the SoftAP web page

If you still want to use the WiFi.begin() for some reason, try the following snippet. You could also use the oak in SYSTEM_MODE(MANUAL) (which tells it to let your code manage both the wifi and particle settings) and just use the built-in Oak.connect() command to connect to your previously configured wifi.

Code: [Select]
WiFi.disconnect()
WiFi.persistent(false);
wstatus = WiFi.begin_internal(SSID, passwd, 0, NULL);

I'd be curious to know how you go converting them to pure ESP8266 Arduino boards... someone was asking about it back in May but I didn't hear any updates as to how successful it had been...

The biggest catch there AFAIK is that the usb on the Oak only provides power - there is no USB-to-serial chip on the Oak (which saves power as well as reduces cost), so you need to supply your own 3.3v compatible usb-to-serial adapter to do the initial programming, and to recover it if your code goes south.