Welcome! Log In Create A New Profile

Advanced

Reset BV507 Wifi

Posted by jon1977 
Reset BV507 Wifi
January 13, 2016 06:19PM
Hi,
is it possible to rested the Wifi module on the BV507?
I've inadvertently got the settings wrong, and I need to get it back to be an Access point to rectify.
Ref this page:
[www.byvac.com]
It says I need to short GPI00 to ground for 10 seconds, but as far as I can tell when mounted on the touch panel there is no access to GPI00.
I can not see a button or wire.
I also can not see how to update firmware as referenced on this page:
[www.byvac.com]
With thanks
Jon.
Re: Reset BV507 Wifi
January 15, 2016 09:38AM
It depends what you mean by reset.

On the BV507 you have access to the wifi uart so you can directly address it through the BV507.

It is most likely that you just want to reset the SSID or IP address etc. This is done by connecting the BV507 to a serial interface and making sure that D4 firmware is installed (here).

If this is installed then type:

print wifi$("info")

This will indicate what the wifi settings are, the formatting is not so good, other wifi commands - commands that directly access the wifi can be used, for a list of commands see here

Also D4 has the wifi commands which makes it easier to set up a station.

// =============================================================================
// set up one time only
//******************************************************************************
// when UART2 is connected the browser cannot be used for set up and so
// this function can be used
// sets ESP8266 as a station
//******************************************************************************
function wf_setStation(ssid$,pass$)
    wifi$("sysflag=240") // turn off browser set up
    wifi$("mode=1") // station
    wifi$("sta="+ssid$+","+pass$)
    wait(500)
    wifi$("reset")
endf

function wf_setIp(ip$[20],gate$[20],port$[20])
    wifi$("ip="+ip$+","+gate$+","+"255.255.255.0")
    wifi$("port="+port$)
endf
Re: Reset BV507 Wifi
January 15, 2016 06:05PM
Hi,
I'm not getting the responses that I'm expecting using Bvserial.
I'm connected to the BV507, and it is responding to commands.
D4 is installed.

Basically I've fixed the wrong Ip address and Gateway.
I believe that I need to firstly type:
wf_start(1)
otherwise, I get error 57, no com port
But I still get the response:
There is no communication with the wifi

If I then type:
print wifi$("info")
I just get the response
ok

I'm assuming to set an IP address to 192.168.1.122 and port 122, I type:
wf_setIp("192.168.001.112","192.168.001.254","112")
I get the response:
ok

If I type in my SSID and password, presumably in this format:
wifi$("sta=MYSSID,MYPASSWORD")
I get the following response:
wifi$("sta=MYSSID,MYPASSWORD")
-1610604672 ok

It however seems that the large negative number changes if I repeat the command.

I've tried:
wifi$("factory")
expecting this to return to factory defaults.
I get the following response:
wifi$("factory")
-1610605184 ok

Do I have the command structures or sequence wrong, is there any other way to reset the Wifi? Or any other advise?
I'm keen to get Wifi up and running!

With thanks

Jon
Re: Reset BV507 Wifi
January 16, 2016 11:02AM
Jon,
there are some errors in above for example you should always precede the wifi$() with print as it returns a string, so the "factory" command may be returning useful information.

However if wf_start(1) is returning no communication with the wifi none of the other commands will not be relevant (falling on deaf ears).

The most likely cause is that the wifi does not have enough power to start. This will be indicated by the LED being dimly lit.

    Led off: Normal operation
    Led on (dim): Not enough power to operate the wifi, the device will not work if the led is continuously illuminated. (Except full configuration as above)
    Led Flashes and then goes off: Normal operation
    Led continues to flash: wifi not configured

The problem is that the wifi consumes a considerable (relatively) start up current, however disconnecting and then reconnecting the BV507 will normally work as there is a large reservoir capacitor for just this purpose will be charged up so the wifi can use that. I have found this depends mostly not on the USB to serial device but to what it is connected to.
Normally the LED will flash brightly and then go off when it finds a router to connect to, or keep flashing if it needs to be configured.

I have updated the BV507 instructions in the light of this. Let me know how you get on.

Jim
Re: Reset BV507 Wifi
January 17, 2016 06:57PM
Hi,
I've checked I've got 5V at the modules VIN, the red led blinks and then extinguishes and I see a small blue LED on the underside of the wifi module which flashes a couple of times if the module is power cycled, but not if it is reset with .r

I fall at the first command I think
wf_start(1) gives the reply:

There is no communication with the wifi
ok

If I do:
print wifiCheck()
I get the reply:
0
OK.

This explains the reply for the wf_start command looking at the associated function in wifi.bas.

I've tried wf_setStation and wf_setIp with my details.
Both reply with ok after a few seconds.

I've cleared the flash with flclear(0) and reloaded BV507_D4.scr off the web.
No difference.

Note, there are a couple of spelling mistakes, and a missing " in your new instructions:
[www.byvac.com]

4) wf_setStation("myssid","mypassword) // NOTE the ""
is missing the end "

I'm guessing there may be a coms issue to the wifi module from the BV507.
It did originally act as an access point, so I think it worked by itself.
Now its attached to the LCD / Touch module I can't get back to it.

Is there anything else I can do?

With thanks
Jon
Re: Reset BV507 Wifi
January 18, 2016 10:09AM
Jon,
thanks for the corrections.

This is a bit of a puzzler. With wifiCheck() not working this means there is no communication between ByPic and the ESP8266. Just thinking out loud this could be:
* wrong Baud rate / misconfiguration
* faulty hardware
* ESP8266 has lost its firmware

If it was working before then the most likely cause is some kind of misconfiguration (but not ruling out some hardware fault). There is one last thing I can think of just to try and get to the bottom of what may be wrong. The technique is to get the ESP8266 back to its factory settings so that a browser can be used to set the configuration (independently of the BV507). This is done by holding GPIO 0 to ground for over 10 seconds. The LED will initially flash and then stay illuminated meaning the the ESP8266 has gone back to the factory settings. When GPIO 0 is released from ground the LED flashes. You can then connect a laptop / PC to the ESP8266 as it will be acting as an access point and then browse to 192.168.4.1 as (here)

The problem you have is that you cant access the back of the device to get at GPIO0 directly on the ESP8266 but it is wired to R4.

R4 is marked on the PCB, just below and to the left of the PIC32. Apply a short to ground on the left hand side of R4, the LED should start flashing, keep the short in place until it continuously illuminates. You will than be in a position to reconfigure by browser.

I don't have access at the moment but will try this a bit later.
*** UPDATE checked works okay but very difficult to get a good ground connection on R4 just poking it with a pin.

Let me know how you get on. If it is a hardware problem then I will replace it.

Jim



Edited 1 time(s). Last edit at 01/18/2016 11:30AM by jimeer.
Re: Reset BV507 Wifi
January 18, 2016 05:45PM
initial response is positive.
The reset on R4 went well.
i could then get on as an access point.
I then set SSID, password, IP, gateway and port, and now:
wf_start(1) returns, OK
print wifiCheck() returns 1 OK
and
print wifi$("info") returns lots of settings.
I've tried some comouts and comread functions between bvserial and a terminal window directed at the BV507 wifi address and I can pass data, so its all looking good!
Thanks for the assistance.
With regards
Jon
Re: Reset BV507 Wifi
January 18, 2016 06:38PM
Jon,
thanks for letting me know, glad to hear its up and running again. I will write this up on the web site as a way of getting out of trouble. I guess it must have been the Baud rate or something like that.

Jim
Sorry, you do not have permission to post/reply in this forum.