M5Stick C 'http GET'
-
Hi,
I am using M5Stick C and have put together a blocky which is a simple http GET process.
i.e. connect to WiFi and send data via GET.
The Data (Key&Value) is populated and the solution successfully sends to the correct URL but...No data is being included in the URL sent.
On checking the Python code, the data is not added.Is this a bug?
Python code generated via Blocky is below and I can provide .m5f if required.
Thanks
Ianfrom m5stack import *
from m5ui import *
from uiflow import *
import wifiCfg
import urequestssetScreenColor(0x111111)
wifiCfg.doConnect('XXXXXXXX', 'XXXXXXXXX')
label0 = M5TextBox(0, 16, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(0, 55, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)if wifiCfg.wlan_sta.isconnected():
label1.setColor(0x3333ff)
label1.setFont(lcd.FONT_DejaVu18)
label1.setText('connected')
try:
req = urequests.request(method='GET', url='http://URL.com/insertGet.php', headers={})
label1.setText('SENT')
label0.setColor(0x33ff33)
label0.setFont(lcd.FONT_DejaVu18)
label0.setText(str(req.status_code))
except:
pass
else:
label1.setColor(0xff0000)
label1.setText('NOT SENT') -
Within Python it seems there are no parameters set.
You can add them in Blockly at Advanced -> Http -> Http Request -> Data with a Map?
Can you provide a screenshot? (If you need an image upload service, use imgpile.com or similar)
-
Sorry, I was not clear.
Within Data>Create Map, I have added key: Temperature, Value:30 and key:Humidity, Value:50
These are not present within the Python code.
I will upload an image of the blocky.
Ian
-
For blocky screen shot https://imgpile.com/i/798bPr
-
It ignores the data when using "GET", if you set it to e.g. "POST" the python code includes the data.
-
Bit confused as to why the 'Data' is ignored in GET.
Switched to POST but data is still not delivered. I will continue to test and se if I can isolate issue.