Uiflow HTTP request
-
Did anyone manage to make this new ui function work?
-
@hetzer not yet, just seen the new functions that have been added
-
Yes, Kind of. But there is weird Behaviour.
I used the following simple block![alt text](image url)
When I run the program using the play button on UIFlow, I get the text "Ok" printed on the LCD.
I get excited and I download the code into the Device, and I get to see the text " Not OK"
The Python Error I get is "list index out of range"
Here is my modified code
from m5stack import *
from m5ui import *
from uiflow import *
import urequestssetScreenColor(0x222222)
label0 = M5TextBox(40, 93, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
try:
req = urequests.request(method='GET', url='https://api.thingspeak.com/apps/thinghttp/send_request?api_key=AAXWP1R39OHJW1U1', headers={'Content-Type':'text/html'})
lcd.print('ok', 0, 0, 0xffffff)
except Exception as e:
lcd.print('not ok', 0, 0, 0xffffff)
label0.setText(str(e)) -
@rupin-chheda It works fine for me after downloading. I think it could be that when running a downloaded program it doesn't auto connect to the wifi, so you have to use the network blocks to setup your wifi, heres my example:
-
With https it's not just with http!
Use this solution for nowurl = str(settings.Gateway.replace("https", "http")) #Es darf nur http genutzt werden kein https res3 = urequests.get(url)
-
@lukasmaximus This worked! thanks!
-
Where is the key value block, it no longer is in the map blocks. Can I please get an example of how to use one of the newer alternate blocks currently available.
-
@jpilarski said in Uiflow HTTP request:
Where is the key value block, it no longer is in the map blocks. Can I please get an example of how to use one of the newer alternate blocks currently available.
Isn’t it here when you press the + button in the map?
-
Thanks so much I totally overlooked the plus sign and I was searching for a block in the map blocks. I’m grateful for you answering my question.