You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 7, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on May 7, 2025. It is now read-only.
More details, for the REST API get method vs a virtualWrite @ arduino, I compiled a c/arduino sketch and all worked right.
REST API I was trying this python code:
... value = '60,1,-34.754129,-56.6964227,test1'
r = lib.urequests.get("http://192.168.1.2:8080/WXiw3UFznFCQxP3rcWpYZf9fV9ydNMYX/update/V60?value="+str(value))
...
it worked for a simple text input widget, not map.
For map, I also captured in input text wigget what was send to V60 virtual pin where I attached the widget map and get this:
'1,-34.754129,-56.6964227,test1'
But with Arduino I have got 0-34.507-56.128position#61 that seems the same but I note some control caracters between values like 0[non ascii]-34.507[non ascii]-56.128[non ascii]position#61
Hi Kindmartin!
Simple blynk.virtual_write(pin, 2, -33.754129, -56.6964227, 'test2') should work for you.
This should add point with certain location to map somewhere in Uruguay ))
When you can do it ( write value)?
Blynk.run means that here hidden auth connect , hadlers registration etc.
For example you can add value widget to display pin value each 10 sec
To learn more about lib implementation capabilities I suggest you to examine examples for different operations
and try to play with them - to get expertise for read/write pin calls https://github.com/blynkkk/lib-python/tree/master/examples
Each example has great description and schema in header. I think they might be very helpful for your findings.
Thanks, Anto, I will re-try and update. I think I tested a lot before on blynk.virtual_write(pin, 2, -33.754129, -56.6964227, 'test2') and similar, but for an unknown something it doesn't works (probably due the usual silly reason I cannot see). I will update soon.
It worked.... thanks and sorry for taking time without more self testing,
btw, Im from Buenos Aires Argentina so those coordinates are some ones I wrote ramdombly.
Traceback (most recent call last):
File "", line 1, in
File "blynklib.py", line 303, in virtual_write
File "blynklib.py", line 166, in send
NameError: name 'IOError' isn't defined
Traceback (most recent call last):
File "", line 1, in
File "blynklib.py", line 303, in virtual_write
File "blynklib.py", line 166, in send
NameError: name 'IOError' isn't defined
AGPS position -34.52527,-58.49914 2Cells 8wifis (accuracy= 20m, rt:3s)
===>>>> memory after update {'ram': {'lat': -34.52527, 'QtyWifis': 8, 'uid': 'fcf5c43cfb60', 'FlagA9GENA': True, 'FlagA9GData': False, 'timestamp': '20210510 13:39:53', 'QtyCells': 2, 'accuracy': 20, 'lon': -58.49914, 'FlagAlarmed': 0}}
[CONNECT_EVENT]
-34.52527 -58.49914 Home #2,20210510 13:39:53
bkw.blynk.virtual_write(60, "clr")
14
updateBlynkLoc each 20 seg
mem free loop: 3597632_
now as a workaround I force to blynk.disconnect() then connect() then do the virtual writes.
Like:
lib. is a module where I just import libraries for this project
bkw. is another module where I have all hw related real pins declarations and class instances
fun. is just a module with all non task especific functions. That’s fun!
Activity
kindmartin commentedon May 6, 2021
More details, for the REST API get method vs a virtualWrite @ arduino, I compiled a c/arduino sketch and all worked right.
REST API I was trying this python code:
...
value = '60,1,-34.754129,-56.6964227,test1'
r = lib.urequests.get("http://192.168.1.2:8080/WXiw3UFznFCQxP3rcWpYZf9fV9ydNMYX/update/V60?value="+str(value))
...
it worked for a simple text input widget, not map.
For map, I also captured in input text wigget what was send to V60 virtual pin where I attached the widget map and get this:
'1,-34.754129,-56.6964227,test1'
But with Arduino I have got 0-34.507-56.128position#61 that seems the same but I note some control caracters between values like 0[non ascii]-34.507[non ascii]-56.128[non ascii]position#61
_#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char ssid[] = "PlantaAlta.2Ghz";
char pass[] = "************************";
char auth[] = "**************************NMYX";
WidgetMap myMap(V60);
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass,IPAddress(192,168,1,2),8080);
int index = 0;
float lat = -34.5074;
float lon = -56.1278;
myMap.location(index, lat, lon, "position#2");
Blynk.virtualWrite(V61, 0, lat, lon, "position#61");
Serial.println( string(0), string(lat), string(lon), "position#61");
}
void loop()
{
Blynk.run();
}_
antohaUa commentedon May 6, 2021
Hi Kindmartin!
Simple blynk.virtual_write(pin, 2, -33.754129, -56.6964227, 'test2') should work for you.
This should add point with certain location to map somewhere in Uruguay ))
When you can do it ( write value)?
Blynk.run means that here hidden auth connect , hadlers registration etc.
For example you can add value widget to display pin value each 10 sec
To learn more about lib implementation capabilities I suggest you to examine examples for different operations
and try to play with them - to get expertise for read/write pin calls
https://github.com/blynkkk/lib-python/tree/master/examples
Each example has great description and schema in header. I think they might be very helpful for your findings.
kindmartin commentedon May 6, 2021
Thanks, Anto, I will re-try and update. I think I tested a lot before on blynk.virtual_write(pin, 2, -33.754129, -56.6964227, 'test2') and similar, but for an unknown something it doesn't works (probably due the usual silly reason I cannot see). I will update soon.
M
kindmartin commentedon May 6, 2021
It worked.... thanks and sorry for taking time without more self testing,
btw, Im from Buenos Aires Argentina so those coordinates are some ones I wrote ramdombly.
/M
kindmartin commentedon May 7, 2021
one more thing before close this one. in arduino we can clean the widget map using myMap.clear() (related to WidgetMap myMap(Pin) )
how we could clean/delete old points ?
,M
antohaUa commentedon May 7, 2021
Kindmartin!
Let's try this approach with python lib )) -> blynk.virtual_write(pin, "clr")
kindmartin commentedon May 10, 2021
It worked charmingly!
Thanks Anto!
PD I still have to understand fix why I get some IOerrors when I try to virtual write vpins
_>>> bkwupdateBlynkLoc each 20 seg")
mem free loop: 3738304
Traceback (most recent call last):
File "", line 1, in
File "blynklib.py", line 303, in virtual_write
File "blynklib.py", line 166, in send
NameError: name 'IOError' isn't defined
Traceback (most recent call last):
File "", line 1, in
File "blynklib.py", line 303, in virtual_write
File "blynklib.py", line 166, in send
NameError: name 'IOError' isn't defined
now as a workaround I force to blynk.disconnect() then connect() then do the virtual writes.
Like:
lib. is a module where I just import libraries for this project
bkw. is another module where I have all hw related real pins declarations and class instances
fun. is just a module with all non task especific functions. That’s fun!
….
**async def loop_garbageC(each_s=60):
#print('async loop_garbageC')
while True:
await lib.uasyncio.sleep(each_s)
lib.gc.collect()
print('mem free loop:',lib.gc.mem_free())
async def updateBlynkLoc(each_s=5):
p = 0
while True:
print("updateBlynkLoc each {} seg".format(each_s))
print('mem free loop:',lib.gc.mem_free())
async def loop_blynk(each_ms=500):
while True:
bkw.blynk.run()
await lib.uasyncio.sleep_ms(each_ms)**
antohaUa commentedon May 16, 2021
Kindmartin!
Can be related to HW python specific.
You mentioned micro_python - thus you need to import not c_python but micro_python lib in your script
https://github.com/blynkkk/lib-python/blob/master/blynklib_mp.py