ESP8266 and Arduino connected by SPI interface

Hi, you really need to make a debug output. As I wrote you in my previous post, make sure you are getting correct values in the in variable. You have to add some Serial.print() in your function.

Hi,

After adding Serial.println() before ā€œelseā€ statement, this is the debug output when i press the button on thinger dashboard :

[_SOCKET] Connecting to [my_server_domain]
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Connected!
[THINGER] Authenticating. User: ****** Device: ********
[THINGER] Writing bytes: 52 [OK]
[THINGER] Authenticated
[THINGER] Available bytes: 25
[THINGER] Writing bytes: 8 [OK]

[THINGER] Writing bytes: 15 [OK]
[THINGER] Available bytes: 86
[THINGER] Writing bytes: 8 [OK]
[THINGER] Available bytes: 58
[THINGER] Writing bytes: 7 [OK]
[THINGER] Available bytes: 30
[THINGER] Writing bytes: 8 [OK]
[THINGER] Available bytes: 19
[THINGER] Writing bytes: 4 [OK]

[THINGER] Writing bytes: 15 [OK]
[THINGER] Available bytes: 19
[THINGER] Writing bytes: 4 [OK]

[THINGER] Writing bytes: 15 [OK]
[THINGER] Available bytes: 19
[THINGER] Writing bytes: 4 [OK]

[THINGER] Writing bytes: 15 [OK]
[THINGER] Available bytes: 19
[THINGER] Writing bytes: 4 [OK]

[THINGER] Writing bytes: 15 [OK]
[THINGER] Available bytes: 19
[THINGER] Writing bytes: 4 [OK]

[THINGER] Writing bytes: 15 [OK]
[THINGER] Available bytes: 19
[THINGER] Writing bytes: 4 [OK]

FYI, i am using my own VPS for the platform.

First, when you add debug printouts, you have to print something unique and useful, not only newline. Any unique text would do.
Second, if the newlines got printed out after you pressed the button and the app should have run the else statement, then something is wrong. Maybe the variable in is always empty. You definitely have to find this out via another debug printout.

Actually, there is exactly same result for the code of ā€œthing[ā€œMachine_Startā€]<< digitalPin(6);ā€.
That code is straight to the point for boolean On & Off.
Another hardware that i am using is only NodeMCU for both main controller & wifi controller, and also executing the same function like this :

thing[ā€œMachine_Onā€]<< (pson& in) {
if(in.is_empty()){
in=(bool)digitalRead(5);
}else{
digitalWrite(5, in ? LOW : HIGH); //Here is the control of the GPIO5
digitalWrite(machine_on, HIGH); // Get start
delay(100); // sending delay 100ms
digitalWrite(machine_on, LOW); // Get low
}
};

The result is good, output pin is high for 100ms then going low. Works perfect.
My point is, there is nothing wrong with ā€œinā€ variable, because another hardware that have direct connection to WiFi prove that this is okay.

Hi @Andrei_Sousa,

What is the progress of this experiment? Did you experience any strange result using WiFiEspIsp?

hi @jiriBilek , using this library for wemos d1 mini pro as wifi module for a teensy4, does it suport udp data transmission , if so any exmples availalble? i want to stream udp in broadcast mode as fast as possible. this is a great little library much much better than the serial at commands !!! regards
phil.

Hi @philw.
On my github you can find and example how to read current time and date from NTP server. This is a UDP communication.


Jiri

yes i saw the code in WiFiSPICmdUdp.cpp a while after i posted!! thanks ill check it out , i also need to start the wifi in accesspoint mode if the supplied ssid is not found. i cant see any equivalent of wifi.beginAp , i was considering adding something to WiFiSPICmdGeneral.cpp
been programming 35 years started in C but not used ot for years and only recently got back into C++. I like your style nic set of routines good structure.