Welcome! Log In Create A New Profile

Advanced

New Firmaware / Wifi

Posted by RuneKvinge 
New Firmaware / Wifi
July 04, 2016 12:34PM
Hi

I just upgraded firmware on my BV508 (to 2.31 serial 201630096) and ESP8266 (to F1_1.9.10). But the wifi connection is not working quite as described at this page: [www.byvac.com]. I use UART1 for the esp8266.

First of all, on 'IoT Wifi' page says 'Update the ESP to the latest version at least F1.9.13 < details of how to do that', but at that page latest version is F1.9.10. I can't find F1.9.13, so my problem is might caused by using version F1.9.10.

I want to use the BV508 as a client connected a server (not http). Manual says that the command '+++send' will connect to server, send the data stored with '+++tosend' command, and then close the connection. Sending the string 12345678 to server:

comclear(1)
comouts(1, "\r\n+++tosend 12345678\r\n")
comouts(1, "\r\n+++send server,port\r\n")

When I try this, the BV508 connects to server, sends the 12345678 and keeps the connection open for 5-10 min, and not closing immediately as described. As long as the connection is open, the server can send data to client on that open connection (shown by the 'com.see()' command)

Furthermore, the command '+++client' should connect to server and keep the connection open until '+++drop' command, and trafic on uart will be forwarded to server. My experience is that the BV508 connects to server and stays connected, but nothing can be sendt to server, only received from server:

comclear(1)
comouts(1, "\r\n+++client server,port\r\n")
comouts(1, "\r\n12345678\r\n")
.
.
.
comouts(1, "\r\n+++drop\r\n")

The '+++client' command is what I prefer to use, but so far had no luck sending data to server, anyone else who have any experience with this?
Re: New Firmaware / Wifi
July 04, 2016 05:11PM
Hi,
the ESP8266_F1_1.9.10 does not work well for the PTH version, use F1_1.9.13 instead (just up loaded it).

It has been a while since I looked at the client firmware as I have been concentrating on the server side with web sockets. The idea of the client was to enable two ESP's to talk to each other. Most other situations for me, require that the ESP be a server and so I have not put much effort in the client side. In fact I have never really used the ESP as a client.

What is the scenario you are using it in? What is the server? I would be interested, let me know and I will look at how the client works again and possibly fix the problems.

Jim
Re: New Firmaware / Wifi
July 04, 2016 09:59PM
Hi Jim

Thank you for your reply. I have flashed with F1.9.13 firmware now, but the problem still remains. The only thing different is that when using the '+++send' command, the esp8266 hold the connection until you send the '+++drop' command. I would realy apreciate if you could take a look at the +++send and +++client problem. When using '+++client' the bv508 can only receive data, not send.

What I'm planning to use the BV508 for, is regulating light, air and temperatur. I have 5 of them, one regulates the vents for floor heating (5 zones with circulating water and also keep the circulating water at 33 degrees celsius), one regulates a fresh air fan and the 3 remaining is each and one connected to a 16 channel pwm (PCA9685) for LED light regulation, a temperature sensor (DS1631) and IR sensor (AMN14112). I'm planning to connect some more sensors later.

The server is a Pythonscript I've made, running under Ubuntu, and a webpage in php for monitoring and regulating settings. The server receives data from the bv508 (trigged by temperature change and movement from ir sensor), and server decides what to do, and sends info back to all the bv508 (like turn on LED). When I'm keeping all connection's open at all time, the communication is faster. That's why I like to use the '+++client' command.

Looking forward to your reply
Re: New Firmaware / Wifi
July 05, 2016 01:27PM
hi,
I must confess I have never done it that way round. I have up to now used the main control (Python) to contact the ESP devices in a round robin fashion. I think it gives me more control and also I can modify the code on the BV508 if UART2 is used without having to physically visit it.

There is also another advantage in that a Javascript application can be set up to contact each individual device if needs be, thus there is no special host software needed, just a browser so a phone can be used. But if you have a central server you can contact that with a browser which negates that advantage.

The client side of things is a bit 'clunky' having to first set up a string and then send it. Thinking out loud I think the only difference is in this instance is who makes contact first. The idea of setting up a string first was to cater for HTTP protocol which expects a header along with the connection and so the string needs setting up first. Again the idea is to be able to contact the various HTTP API to get time etc.

I am happy to look into this, it would mean opening a socket to a server which would be exactly the same as it is now but the other way round. My only concern is that is it really necessary? It will take some effort to do and so I would like it to add value to the firmware but I just don't see that it would. Am I missing something?

Let me know what you think
Jim
Re: New Firmaware / Wifi
July 05, 2016 08:27PM
Hi Jim

Thank you. I will try what you suggest, and if no luck I will come back to you :-)
Sorry, you do not have permission to post/reply in this forum.