@liemph Sorry, I have solved my problem by watching Lucas video on YouTube.
Best posts made by liemph
-
RE: How to use two ENV units with PaHUB (UIFlow)
-
RE: M5Atom and Grove Sensors
- The device on 0x68 is MPU6886 (gyro, accelerometer).
I have checked the sample program for the MPU6886 (it worked):
https://github.com/m5stack/M5Atom/blob/master/examples/Basics/MPU6886/MPU6886.ino - The Atom grove port is for I2C devices (similar to other M5 cores, for example, M5Stack Fire is Port A). So you can connect any I2C Unit to this port. There is no Arduino example available for connecting an I2C M5 Unit to an Atom but the main difference is only in the GPIO Pin definition. The Atom I2C uses GPIO Pin 26 and 32. These are different with for example M5Stack Fire Port A use GPIO Pin 21 and 22.
I do not have time to try connecting a Unit to an Atom, but I will share my test in the future.
https://github.com/m5stack/M5Atom
- The device on 0x68 is MPU6886 (gyro, accelerometer).
-
Unstable program uploading to M5Stack Fire.
I purchased an M5Stack Fire from AliExpress from the official M5Stack Store several months ago. I use Arduino IDE 1.8.10 (Windows 8.1, 64 bit), baud rate 115200 for uploading my sketches. When I start from the cold condition (the core is not powered on for a long time) then I can upload successfully several times. However, after a long debugging process (which I consider the Fire is entering a hot condition) I experience a connection error and my sketches are not uploaded.
I have other core products such as FACES and M5Stick C and no such trouble occurs with the same IDE, baud rates and cable.
Is there any solution for this?
-
RE: M5StickC + 18650C (HAT external battery) BAT pin
@m5stack This means that when the Stick is plug to the 18650C accessory, the 18650C accessory will not charge the internal battery?
-
RE: M5Atom and Grove Sensors
@madgeometer I have just tried to connect a TOF Unit to my Atom Matrix via its grove port. Since the Atom Matrix does not have LCD than the distance measurement results are sent via the serial port. The code is taken from the TOF Unit example for M5 Stack. I modified:
- Wire.begin() -> Wire.begin(26,32)
- M5.begin() is moved BEFORE the Wire.begin(26,32)
Check this list:
// the original code by Ted Meyers // posted here: https://groups.google.com/d/msg/diyrovers/lc7NUZYuJOg/ICPrYNJGBgAJ // if your tof have some problem, please see https://docs.m5stack.com/#/en/unit/tof // // Modified by from M5Stack Fire Example to be suited for M5 Atom Matrix (liemph, 2020) // #include "M5Atom.h" #include <Wire.h> #define VL53L0X_REG_IDENTIFICATION_MODEL_ID 0xc0 #define VL53L0X_REG_IDENTIFICATION_REVISION_ID 0xc2 #define VL53L0X_REG_PRE_RANGE_CONFIG_VCSEL_PERIOD 0x50 #define VL53L0X_REG_FINAL_RANGE_CONFIG_VCSEL_PERIOD 0x70 #define VL53L0X_REG_SYSRANGE_START 0x00 #define VL53L0X_REG_RESULT_INTERRUPT_STATUS 0x13 #define VL53L0X_REG_RESULT_RANGE_STATUS 0x14 #define address 0x29 byte gbuf[16]; void setup() { // put your setup code here, to run once: M5.begin(); // Wire.begin() must be after M5.begin() Wire.begin(26, 32); // Atom Matrix I2C GPIO Pin is 26 and 32 <- Important Serial.begin(115200); // start serial for output Serial.println("VLX53LOX test started."); } void loop() { Serial.println("----- START TEST ----"); test(); Serial.println("----- END TEST ----"); Serial.println(""); delay(500); } void test() { byte val1 = read_byte_data_at(VL53L0X_REG_IDENTIFICATION_REVISION_ID); Serial.print("Revision ID: "); Serial.println(val1); val1 = read_byte_data_at(VL53L0X_REG_IDENTIFICATION_MODEL_ID); Serial.print("Device ID: "); Serial.println(val1); val1 = read_byte_data_at(VL53L0X_REG_PRE_RANGE_CONFIG_VCSEL_PERIOD); Serial.print("PRE_RANGE_CONFIG_VCSEL_PERIOD="); Serial.println(val1); Serial.print(" decode: "); Serial.println(VL53L0X_decode_vcsel_period(val1)); val1 = read_byte_data_at(VL53L0X_REG_FINAL_RANGE_CONFIG_VCSEL_PERIOD); Serial.print("FINAL_RANGE_CONFIG_VCSEL_PERIOD="); Serial.println(val1); Serial.print(" decode: "); Serial.println(VL53L0X_decode_vcsel_period(val1)); write_byte_data_at(VL53L0X_REG_SYSRANGE_START, 0x01); byte val = 0; int cnt = 0; while (cnt < 100) { // 1 second waiting time max delay(10); val = read_byte_data_at(VL53L0X_REG_RESULT_RANGE_STATUS); if (val & 0x01) break; cnt++; } if (val & 0x01) Serial.println("ready"); else Serial.println("not ready"); read_block_data_at(0x14, 12); uint16_t acnt = makeuint16(gbuf[7], gbuf[6]); uint16_t scnt = makeuint16(gbuf[9], gbuf[8]); uint16_t dist = makeuint16(gbuf[11], gbuf[10]); byte DeviceRangeStatusInternal = ((gbuf[0] & 0x78) >> 3); Serial.print("ambient count: "); Serial.println(acnt); Serial.print("signal count: "); Serial.println(scnt); Serial.print("distance "); Serial.println(dist); Serial.print("status: "); Serial.println(DeviceRangeStatusInternal); } uint16_t bswap(byte b[]) { // Big Endian unsigned short to little endian unsigned short uint16_t val = ((b[0] << 8) & b[1]); return val; } uint16_t makeuint16(int lsb, int msb) { return ((msb & 0xFF) << 8) | (lsb & 0xFF); } void write_byte_data(byte data) { Wire.beginTransmission(address); Wire.write(data); Wire.endTransmission(); } void write_byte_data_at(byte reg, byte data) { // write data word at address and register Wire.beginTransmission(address); Wire.write(reg); Wire.write(data); Wire.endTransmission(); } void write_word_data_at(byte reg, uint16_t data) { // write data word at address and register byte b0 = (data & 0xFF); byte b1 = ((data >> 8) && 0xFF); Wire.beginTransmission(address); Wire.write(reg); Wire.write(b0); Wire.write(b1); Wire.endTransmission(); } byte read_byte_data() { Wire.requestFrom(address, 1); while (Wire.available() < 1) delay(1); byte b = Wire.read(); return b; } byte read_byte_data_at(byte reg) { //write_byte_data((byte)0x00); write_byte_data(reg); Wire.requestFrom(address, 1); while (Wire.available() < 1) delay(1); byte b = Wire.read(); return b; } uint16_t read_word_data_at(byte reg) { write_byte_data(reg); Wire.requestFrom(address, 2); while (Wire.available() < 2) delay(1); gbuf[0] = Wire.read(); gbuf[1] = Wire.read(); return bswap(gbuf); } void read_block_data_at(byte reg, int sz) { int i = 0; write_byte_data(reg); Wire.requestFrom(address, sz); for (i = 0; i < sz; i++) { while (Wire.available() < 1) delay(1); gbuf[i] = Wire.read(); } } uint16_t VL53L0X_decode_vcsel_period(short vcsel_period_reg) { // Converts the encoded VCSEL period register value into the real // period in PLL clocks uint16_t vcsel_period_pclks = (vcsel_period_reg + 1) << 1; return vcsel_period_pclks; }
-
Issue with Port C (UART) of M5Stack Fire (Finger unit OK but GPS No Good)
I am aware that there is an issue related to the UART port (Port C) of M5Stack Fire. However, using the UIFlow (1.4.5) I managed to connect and program the Finger unit normally. However, with the GPS unit, I failed to make it work. I do not understand why for the core works with the Finger unit but not with the GPS (same Port C).
-
RE: M5StickC and 18650C endurance
@kees I bought with the brand Keweisi from Aliexpress a long time ago (same with the one mentioned by @ajb2k3 ?). But I could not find now. However, I found a very close one in Aliexpress:
10 in 1 Digital Dispay DC USB Tester Current Voltage Charger Voltmeter power bank wattmeter voltage tester doctor detector (462 Japanese Yen + 12 Yen Shipping to Japan).
-
RE: M5Atom and Grove Sensors
@madgeometer
It worked perfectly. This is the serial log I had:----- START TEST ---- Revision ID: 16 Device ID: 238 PRE_RANGE_CONFIG_VCSEL_PERIOD=7 decode: 16 FINAL_RANGE_CONFIG_VCSEL_PERIOD=5 decode: 12 ready ambient count: 46 signal count: 7 distance 1854 status: 11 ----- END TEST ----
-
RE: No data on Grove C/UART2 ...
@buhhe said in No data on Grove C/UART2 ...:
@liemph Thanks for the feedback and i hope my solution helps!
I had asked the M5Stack support for that problem and they wrote me "The PSRAM was soldered on to the board. Cant disable it." That implies in my understandig that the Port C cannot used since the PSRAM uses the same pins as Port C. And looking closer to the M5Stack support-replies above shows no contradicition to my assumes but only some unclear statements and regrets.
For me is no doubt that the Port C of the "Fire" is a kind of rudiment of earlier M5Stack versions. The Port is not usable in the "Fire".Ok, I have to give up or unsoldering the pin which I certainly will not do it.
My decision of buying the FIRE version of M5Stack core was based partly on the PSRAM. I think it is a faulty design. -
RE: Issue with Port C (UART) of M5Stack Fire (Finger unit OK but GPS No Good)
@ajb2k3 said in Issue with Port C (UART) of M5Stack Fire (Finger unit OK but GPS No Good):
@liemph do you get an error message or just no response?
Your question alerted me. I used the GPS example provided by M5 for UiFlow. The LCD showed that the Time is 00:00:00, no data in Lattitude and Longitude, the Quality showed NO Signal. I tested it at home (inside my house). So is it possible that I have to look for a better place to get a stronger signal? However other devices using GPS work well inside my house.
-
RE: ENV+Relay
@Kris The ENV unit uses I2C interface while the Relay unit uses a single bus (simple digital i/o) interface. For example, if you use M5Stack Fire, as default, the ENV unit is connected to Port A (I2C) and the Relay unit to Porb B (I/O). For some reason, if you really need to use Port A for your Relay unit, of course, you can. But you have to carefully program the correct pin of Port A to work as an output port to control the relay. To be more precise, the pin for SDA of (I2C) (yellow color) of Port A should be programmed to be an output pin (corresponding to the REL pin of your Relay unit). For this particular case, the fourth pin (SCL, white color) of the Port A is not used. The same grove cable can be used for both units. Good luck.