I think the Python code in these units was not implemented with PbHUB in mind at all. I agree with your suggested interface will be very useful. You can probably do this by deriving a HubAwareLight
class from Light
. The job of HubAwareLight
is to just set newdata
value in Light
Posts made by ws1088
-
RE: Connect units to PbHUB
-
RE: Connecting Env Unit and RFID Unit via Grove Hub on M5StickC
@ajb2k3 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:
@ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat
wow, RFID unit will not work with ENV hat even? I though RFID unit is I2C (G32 and G33) and ENV hat is on G26 and G36...
-
RE: Problems with the I2C Grove Interface
@staind87 said in Problems with the I2C Grove Interface:
Hello dear M5Stack Team,
I come from Germany and unfortunately my English is not perfect.
I hope you can understand me.I think the 5MStack product line is really good. It's all in a nice case and the products are well made.
Now I unfortunately noticed a few things which are not so beautiful, but maybe I didn't see it correctly.It's about the I2C Grove interface. I think there are some hardware design bugs.
Unfortunately I can't see the I2C Grove interface in the schematics of the M5Stack.
Therefore I assume that SCL and SDA from the Grove interface are directly connected to the ESP32. (without logic)Now to the problems:
-
A level shifter is missing in the M5Stack.
If I look at the schematics of the sensors (e.g. the ENV unit) I can see that the pull-up resistors in the sensor modules are connected to 5V (VCC).
This means that 5V is connected to the inputs of the ESP32. The ESP32 only supports voltages up to 3.6V. The 5V voltage could demage the I2C inputs of the M5Stack.
With a level shifter in the M5Stack this problem could be solved. -
The pull-up resistors are built into the sensors.
Unfortunately the pull-up resistors are built into the sensors. This is very unfortunate because if I use the Unit Hub to use several sensors then I have several pull-up resistors parallel to my I2C bus.
The total resistance of the pullup is getting smaller and smaller due to this.
So maybe bigger circuits can't work anymore because the pullup resistance is too small.
Why is the pull-up resistor not installed centrally in the M5Stack?
I hope you don't misunderstand me. I love the M5Stack, but I noticed these problems.
Greetings from Germany
Staind
I recently have problems with using both ENV unit and TOF unit on a I2C hub on M5StickC. Using just 1 one of them at one time works. I wonder if this is related to what you discovered?
Also, would using a PaHub solve the problem?
-
-
RE: Documentation of all available python modules and APIs for M5StickC
@ajb2k3 said in Documentation of all available python modules and APIs for M5StickC:
Micropython is still unstable and constantly changing which is why there are not uptodate records.
M5Stack used to use the Loboris port but have since switched to their own port.
So then would a Firmata python client be more stable (since the Firmata protocol is stable)?
-
Documentation of all available python modules and APIs for M5StickC
I am trying to look for what I can do with micropython on M5StickC and couldn't find a comprehensive online documentation. Is there something like that?
For the core micropython code I can see there is a place to look for it. But for APIs specifically for M5StickC (of M5Stack), it seems like it is sorely missing. e.g. where is the API documented for:
lcd.setRotation()
etc? Thanks in advance!
-
RE: UIFlow source code for M5StickC?
@heybin Thanks. Is there a StickC branch for UIFLow_Code as well? I looked at https://github.com/m5stack/UIFlow-Code/blob/master/i2c_bus.py and PORTA is (21, 22) for M5Stack, not (32, 33) for M5StickC.
-
UIFlow source code for M5StickC?
Is UIFlow open source? Looks like the UIFlow for M5Stack is available in github, but I cannot find the code for M5StickC.
Generally, do you guys think it is a good idea to be able to build our only firmware (with micropython support for various units and component/drivers on M5StickC)?
-
RE: Battery life of M5StickC when it is powered OFF
@oliv said in Battery life of M5StickC when it is powered OFF:
@lukasmaximus : I agree with @ws1088 . Battery fully charged, long press on power switch to switch off the M5StickC should not drain battery in 5 hours.
I measured a consumption of 1.92 mA when off, which is too high :(
See measurements: http://community.m5stack.com/topic/1162/getting-longer-battery-run-time/5Today I did something different, I unplug every units from M5StickC and so far it still have battery when I tried to turn it on. After it is on, I turned it off immediately and will report out how long it will last. Sorry, I can only do these unscientific experiment :) I lack the knowledge and equipment to do otherwise.
-
RE: UIFlow USB Mode Questions
@ajb2k3 said in UIFlow USB Mode Questions:
@ws1088 said in UIFlow USB Mode Questions:
@lukasmaximus said in UIFlow USB Mode Questions:
The Api key is for connecting your stick c to the online version of uiflow (flow.m5stack.com) in the settings menu you can enter your apikey and switch from m5stack unit to stick c unit
The interesting thing is in
USB mode
you still get an apikey. I tried entering that key in the online version of UIFlow and it is not working...It wont work because in USB mode the M5Stack has not connected over the wifi and so the online UIFlow cannot find it.
This is a bug or a feature of the upcoming WebUSB function coming soon.Thanks, lets hope it is a feature for the online version of UIFlow instead of a bug :)
-
RE: Connecting Env Unit and RFID Unit via Grove Hub on M5StickC
@ajb2k3 said in Connecting Env Unit and RFID Unit via Grove Hub on M5StickC:
@ws1088 Confirmed, the RFID Unit will not work with the ENV unit and will not work with the ENV hat
Is the reason as you mentioned that there is not enough power? I guess not because you test it on the ENV hat with RFID unit. I noticed a lot of bus error (timeout), maybe it's a software issue? I am using UIFlow, btw. Are you using Arduino IDE and C++?
-
RE: Battery life of M5StickC when it is powered OFF
Since the power button is not a real physical switch (but a push button), there are bounded to be current used up. And who knows what UiFlow launcher (I am using version 1.3.2) or the OS is not doing when we long press the power button. :(
-
RE: UIFlow USB Mode Questions
@lukasmaximus said in UIFlow USB Mode Questions:
The Api key is for connecting your stick c to the online version of uiflow (flow.m5stack.com) in the settings menu you can enter your apikey and switch from m5stack unit to stick c unit
The interesting thing is in
USB mode
you still get an apikey. I tried entering that key in the online version of UIFlow and it is not working... -
RE: Does the Env Hat cover the IR and LED?
Sorry, it turns out I only have the speaker hat. And the opening does not "pass thru" from one side to the connector side. But I guess you can find a way to cut out the opposite side?
-
RE: Does the Env Hat cover the IR and LED?
I have the Env Hat and it blocks the IR and LED. I don't have the Hat with me now, I can check tonite and update you if it is otherwise.
-
RE: Connecting Env Unit and RFID Unit via Grove Hub on M5StickC
It looks like Env unit has 2 I2C addresses (92, 118)? But many times 92 will go away in the scan loop. Strange...
-
Battery life of M5StickC when it is powered OFF
I charged the unit for a long time and then powered it OFF (by long pressing the power button). After a few hours I cannot powered it on again. Looks like it is out of battery.
Is this an unexpected behavior?
-
RE: Connecting Env Unit and RFID Unit via Grove Hub on M5StickC
I use the following code to test:
from m5stack import * from m5ui import * from uiflow import * import i2c_bus setScreenColor(0x111111) devices = None scan = None i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x68) devices = [] while True: scan = i2c0.scan() if devices != scan: lcd.clear() lcd.print(str(scan), 0, 0, 0xffffff) devices = scan wait_ms(2)
I can see the I2C addresses for the Env unit and RFID unit combinations when I plug them into the Grove Hub. I can plug the Env unit in to see addresses 92 and 118, then add RFID unit to see [40, 92, 118] etc.
So I am pretty clueless why the following will fail:
rfid0 = unit.get(unit.RFID, unit.PORTA) env1 = unit.get(unit.ENV, unit.PORTA)
Looks like I need to go to the source code and see what's going on...
-
Connecting Env Unit and RFID Unit via Grove Hub on M5StickC
Individually connect to the Grove Hub works. But if I put both on the hub, it will gives
ENV unit maybe not connect
This is the code from UIFlow:
from m5stack import * from m5ui import * from uiflow import * import unit setScreenColor(0x111111) rfid0 = unit.get(unit.RFID, unit.PORTA) env1 = unit.get(unit.ENV, unit.PORTA) wait(1) while True: lcd.print((('C: ' + str((env1.temperature)))), 0, 0, 0x3366ff) lcd.print((('RFID: ' + str((rfid0.readUid())))), 0, 10, 0x3366ff) wait_ms(200)
Even if I manually switched the order to:
env1 = unit.get(unit.ENV, unit.PORTA) rfid0 = unit.get(unit.RFID, unit.PORTA)
I still get:
ENV unit maybe not connect
What am I doing wrong? Thanks in advance!
-
UIFlow USB Mode Questions
I have a few questions on
USB mode
on M5StackC.- Is
USB mode
only for UIFlow offline application? - After I switched to
USB mode
, the unit display an APIKEY. What is it for? I run UIFlow offline application and it basically connect via COM port.
- Is