@rashedtalukder Congrats, hope you are on to somewhere that appreciates your skills!

Posts made by greenleaf
-
RE: AWS IoT Edukit Core M5 - Micropython support?
-
RE: Edukit ATECC608B & AWS IOT & UiFlow
@ajb2k3 It's super buggy. I tried getting this ATECC608 chip working with Arduino code and had very inconsistent results, kernel panics and crashes. The only way I've seen it run consistently is by running the RTOS code in the AWS edukit tutorials.
-
RE: ATOM Matrix - IMU values all over the place
Wow, your balancing star is impressive!
I'm just playing around in UIFlow to see what's possible with this device.
-
ATOM Matrix - IMU values all over the place
I wrote a small program to print out the IMU X, Y, and Z accel values to the serial port.
It seems the readings can be pretty erratic, jumping from near zero to 0.4 or 0.5 even when the device is completely still.
How do you all deal with this? I tried taking the average of the last 5 readings which seems to help a little but it's still kind of jumpy.
Have a look. This is sitting completely flat on the desk:
X: -0.021 Y: -0.011 Z: -0.987 X: 0.421 Y: -0.014 Z: -0.986 X: 0.421 Y: -0.014 Z: -0.987 X: -0.018 Y: -0.016 Z: -0.986 X: -0.022 Y: -0.014 Z: -0.986 X: 0.423 Y: -0.013 Z: -0.987 X: 0.42 Y: -0.015 Z: -0.987 X: 0.417 Y: -0.013 Z: -0.988 X: 0.419 Y: -0.012 Z: -0.984 X: -0.015 Y: -0.011 Z: -0.984 X: -0.02 Y: -0.013 Z: -0.987 X: -0.017 Y: -0.014 Z: -0.987 X: 0.423 Y: -0.014 Z: -0.988 X: -0.019 Y: -0.012 Z: -0.986 X: -0.027 Y: -0.013 Z: -0.988 X: 0.421 Y: -0.013 Z: -0.99 X: 0.423 Y: -0.017 Z: -0.988 X: 0.421 Y: -0.016 Z: -0.988 X: 0.423 Y: -0.011 Z: -0.987 X: 0.42 Y: -0.008 Z: -0.987 X: -0.021 Y: -0.013 Z: -0.986 X: -0.018 Y: -0.014 Z: -0.99 X: -0.022 Y: -0.011 Z: -0.99 X: 0.42 Y: -0.013 Z: -0.984 X: 0.423 Y: -0.012 Z: -0.988 X: -0.023 Y: -0.014 Z: -0.984 X: 0.421 Y: -0.016 Z: -0.985 X: 0.417 Y: -0.015 Z: -0.985
-
Set Atom Matrix block duplication bug - color reverts to white
When you copy this block and change the color, it makes pixels white:
When making animations you always want to copy the previous frame. This is inconvenient because every block must be created from scratch.
-
First button press not detected on ATOM Matrix
Has anyone else observed this? When I have a button handler the first time I click it doesn't get detected. But subsequent presses work fine. This happens for short, double, or long clicks consistently.
-
RE: Is machine.deepsleep() possible with a Core 2?
@felmue I think I found the issue; my deepsleep() call was inside a loop. Moving it outside the loop sorted it out.
-
Azure IoT Speaker play_local path variable does not work
This does not work:
But this does:
For some reason you have to hard-code the string of the local file path, this handler won't accept the variable and produces an error:
OSError [Errno 2] ENOENT
-
Azure IoT Speaker play_cloud command broken
This Azure handler won't play cloud based wav files. The play_local works fine though. The error message shown when trying to play a WAV URL is below:
Unhandled exception in thread started by <bound_method> Traceback (most recent call last): File "libs/m5mqtt.py", line 101, in _msg_deal_task File "libs/m5mqtt.py", line 88, in update File "umqtt/robust.py", line 80, in check_msg File "umqtt/simple.py", line 271, in check_msg File "umqtt/simple.py", line 259, in wait_msg File "libs/m5mqtt.py", line 50, in _on_data File "IoTcloud/Azure.py", line 333, in direct_method_cb File "<string>", line 33, in azure_direct_Speaker_play_cloud File "hardware/speaker.py", line 135, in playCloudWAV File "hardware/speaker.py", line 82, in playWAV ValueError: Data Format is not valid
-
RE: Azure IoT Handle Example for Speaker play_cloud command?
In case anyone else has the same issue...the handler works if you hard-code the path to the Wav file
but cloud path doesn't work with the same trick, it still gives the Data format is not valid error.
-
RE: Azure IoT Handle Example for Speaker play_cloud command?
I also tested this with a local file but get a different error:
OSError [Errno 2] ENOENT
-
RE: Azure IoT Handle Example for Speaker play_cloud command?
I added it to my model so you get a UI field in Azure now for pasting in the cloud wav file URL:
The command gets to the device but it can't parse it for some reason, get a Data Format Invalid error.
Traceback (most recent call last): File "libs/m5mqtt.py", line 101, in _msg_deal_task File "libs/m5mqtt.py", line 88, in update File "umqtt/robust.py", line 80, in check_msg File "umqtt/simple.py", line 271, in check_msg File "umqtt/simple.py", line 259, in wait_msg File "libs/m5mqtt.py", line 50, in _on_data File "IoTcloud/Azure.py", line 333, in direct_method_cb File "main.py", line 32, in azure_direct_Speaker_play_cloud File "hardware/speaker.py", line 135, in playCloudWAV File "hardware/speaker.py", line 82, in playWAV ValueError: Data Format is not valid
-
Azure IoT Handle Example for Speaker play_cloud command?
Anyone know what to put here for the Payload? I want to play a sound with the play_cloud command.
-
RE: M5Stick CPlus Battery Replacement
@hwtaro9 makes sense. The battery is tiny, probably only useful for small toy drones or maybe low power LCD displays
-
Is machine.deepsleep() possible with a Core 2?
I have a Core 2 for AWS but figured the base hardware is the same so this should apply to the Core 2 as well.
When I tried to do a machine.deepsleep(10000) the device just goes into a boot loop. It doesn't wait ten seconds. Seems like it might be trying to go to sleep then immediately restarting.
Anyone have deepsleep working on a Core 2 device?
It definitely gets the deepsleep signal, this is what I see in the serial output
rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:5228 load:0x40078000,len:13424 load:0x40080400,len:3568 entry 0x4008063c _ __ _ _ _(_)/ _| | _____ __ | | | | | |_| |/ _ \ \ /\ / / | |_| | | _| | (_) \ V V / \__,_|_|_| |_|\___/ \_/\_/
-
RE: UIFlow wifi connect forces screen background to be white
After some more troubleshooting I discovered that a 10ms wait after changing the screen color allows the first few lines to print when working in UIFlow. It appears that 'Set Screen backgroundColor' requires this delay before you can render text with Lcd.print.
This doesn't solve the mystery of the white screen when running in app mode though. Maybe someone else knows what's going on here.
-
RE: UIFlow wifi connect forces screen background to be white
Little more context for anyone reading this thread:
-
In UIFlow mode the screen does turn black, but none of the first Lcd.print statements work at all. I've tried adding delays, moving things around, nothing seems to fix it. As long as that wifi connect is up there at the top the first several Lcd.print lines don't work.
-
If I download the code onto the m5stack core2, then those lines do print but I'm stuck with a white background. The Set Screen backgroundColor command never works when I run the app standalone.
Here is how the raw Python code looks for the sketch screenshot I posted:
from m5stack import * from m5stack_ui import * from uiflow import * import wifiCfg import time import ntptime import urequests from easyIO import * import unit screen = M5Screen() screen.clean_screen() # Why is this here? I didn't put any clean_screen() block in my code... screen.set_screen_bg_color(0x000000) neopixel_0 = unit.get(unit.NEOPIXEL, (25,22), 10) try : wifiCfg.autoConnect(lcdShow=False) pass except: lcd.print('Unable to connect to wifi: CAROLAN', 0, 0, 0xcc0000) neopixel_0.setColorFrom(1, 10, 0xcc0000) wait(5) screen.set_screen_bg_color(0x000000) lcd.print('test test test', 0, 90, 0x33cc00) lcd.print('Welcome to M5Stack Core 2 AWS', 0, 15, 0x33cc00) lcd.print('Setting the time from us.pool.ntp.org...', 0, 30, 0x33cc00) try : ntp = ntptime.client(host='us.pool.ntp.org', timezone=(-5)) lcd.print(((str('Current time:') + str((ntp.formatDatetime('-', ':'))))), 0, 45, 0x33cc00) pass except: lcd.print('Error setting time. Check your wifi settings.', 0, 45, 0xff0000) try : try: req = urequests.request(method='GET', url='https://www.google.com') lcd.print('Connect to www.google.com: SUCCESS', 0, 60, 0x33cc00) neopixel_0.setColorFrom(1, 10, 0x33cc00) except: lcd.print('Connect to www.google.com: FAILURE', 0, 60, 0xff0000) pass except: lcd.print('Internet connection test failed.', 0, 60, 0xff0000) lcd.print(((str(((str('Battery level: ') + str((map_value((power.getBatVoltage()), 3.7, 4.1, 0, 100)))))) + str('%'))), 0, 75, 0x33cc00) power.setPowerLED(False)
-
-
RE: UIFlow wifi connect forces screen background to be white
Another odd thing I've noticed is that the first one or two lines of Lcd.print don't show up at all. What exactly is that wifi connect doing besides, well, connecting to wifi?
I've annotated what is not printing to the screen:
-
RE: AWS IoT Edukit Core M5 - Micropython support?
@ajb2k3 Thanks. Yes, it looks like UIflow has evolved quite a bit since last year. I'm happy to see you can execute custom code now, and that there are some dedicated hooks for things like AWS IoT.