@laursena please check the version of ClosedCube.cpp and ClosedCube.h you are using. The one that is provided by M5stack is the newest.
(* In the examples of M5StickCPlus in the directory Unit/PaHub you may find these documents. *)
Posts made by HappyUser
-
RE: RFID 2 unit and I2C hub 1 to 6 expansion unit
-
RE: RFID 2 unit and I2C hub 1 to 6 expansion unit
SOLVED : After remeniscing abount my life, and specifically what goes wrong here, i just realised : could it be that I am using an outdated library of ClosedCube. And yes, after using the version from 4 April 2023, everything works fine now.
@felmue In Dutch : Krijg nou wat?
I put the RFID 2 module in slot 1 of the TCA 9548A module and then in channel 0 (weird because i have placed it in channel 1) i see address 0x28 of the RFID popping up.Does this mean that channel 0 on the module is not usable?
ThanksIn follow_up , I have checked ClosedCube_TCA9548A.cpp and the selctChannel goes like this :
uint8_t ClosedCube::Wired::TCA9548A::selectChannel(uint8_t channel) { uint8_t result = 0xff; if (channel < TCA9548A_MAX_CHANNELS) { Wire.beginTransmission(_address); Wire.write(((uint8_t)1) << (channel)); _currentChannel = channel; result = Wire.endTransmission(); } return result; }
That seems to be correct if I read the documentation of the Texas Instrument module TCA9548A
I am really misunderstaning something or could it be that their is somekind of wire mixup in the module?
Btw, I also dont see a reset channel somewhere in the code.
Now i did another experiment using PCA9548AP (the newer version).
Plugging in the RFID in channel 0 gives no response.
Plugging in channel 1 : software tels me the device is in channel 0
Plugging in a second RFID in channel 2 :software tells met a I have another device in channel 1.I tried to increase the max number of channels to 8 (assuming that channel 0 is somehow connected to channel 7 of 8). Still no response when i attach a device physically on channel 0.
This is really weird behaviour. I hope someone is at least able to reproduce this behaviour.
-
RE: M5 Unit Scroll Arduino Example
@cepics Have you checked whether M5UnitScroll.begin returns true? Baybe that gives a clue.
Regards -
RE: RFID 2 unit and I2C hub 1 to 6 expansion unit
@felmue Sorry for my late response, been a bit occupied. Tried exacltly the include code with the most recent version of M5Unified (0.2.1) and M5Stack board manager (version 2.1.2). Connect the RFID 2 unit to slot 0 of the TCA9548A module (boh M5Stack products.
It only lists for each channel 0x70 wire ping value. I would have expected for channel 0 to have a response on 0x28 (native wire address of the RFID 2 module). Maybe it is because the RFID module has not been inititated yet. But I do not know where to put the init of the RFID module. Tried at different place in the code , to no avail. I hope someone has an idea of where I am going wrong here.```
//#include <M5Core2.h>
#include <M5Unified.h>
#include <Wire.h>#include "ClosedCube_TCA9548A.h"
#define FRONT 2
#define X_LOCAL 100
#define Y_LOCAL 35
#define X_OFFSET 160
#define Y_OFFSET 34#define PaHub_I2C_ADDRESS 0x70
ClosedCube::Wired::TCA9548A tca9548a;
void setup() {
M5.begin();
Wire.begin();
tca9548a.address(PaHub_I2C_ADDRESS); // Set the I2C address. 设置I2C地址
M5.Lcd.setTextFont(4);
M5.Lcd.setCursor(70, 0, 4);
M5.Lcd.setTextColor(YELLOW, TFT_BLACK);
M5.Lcd.println(("PaHUB Example"));
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
}void loop() {
uint8_t returnCode = 0;
uint8_t address;
for (uint8_t channel = 0; channel < TCA9548A_MAX_CHANNELS; channel++) {
M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT);
M5.Lcd.printf(
" ");
M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT);
M5.Lcd.printf("CH%d : ", channel);
returnCode = tca9548a.selectChannel(channel);
if (returnCode == 0) {
for (address = 0x01; address < 0x7F; address++) {
Wire.beginTransmission(address);
returnCode = Wire.endTransmission();
if (returnCode == 0) {
Serial.print("I2C device = ");
M5.Lcd.printf("0X%X ", address);
}
}
}
delay(200);
}
} -
RFID 2 unit and I2C hub 1 to 6 expansion unit
Hello,
The RFID 2 unit works fine when connected directly to M5Core2.
Now, I connect the I2C hub to the M5Core 2 and connect the RFID 2 device to channel 0 of the I2C hub.
I run the following programs. I would assume that the RFID 2 device would show with address 0x28. But it does not, it only gives 0X70 which is the I2C device itself. What am i missing here?#include <M5Core2.h> #include "ClosedCube_TCA9548A.h" #define FRONT 2 #define X_LOCAL 100 #define Y_LOCAL 35 #define X_OFFSET 160 #define Y_OFFSET 34 #define PaHub_I2C_ADDRESS 0x70 ClosedCube::Wired::TCA9548A tca9548a; void setup() { M5.begin(); //M5.Power.begin(); //wire.begin(); tca9548a.address(PaHub_I2C_ADDRESS); // Set the I2C address. 设置I2C地址 M5.Lcd.setTextFont(4); M5.Lcd.setCursor(70, 0, 4); M5.Lcd.setTextColor(YELLOW, TFT_BLACK); M5.Lcd.println(("PaHUB Example")); M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK); } void loop() { uint8_t returnCode = 0; uint8_t address; for (uint8_t channel = 0; channel < TCA9548A_MAX_CHANNELS; channel++) { M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT); M5.Lcd.printf( " "); M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT); M5.Lcd.printf("CH%d : ", channel); returnCode = tca9548a.selectChannel(channel); if (returnCode == 0) { for (address = 0x01; address < 0x7F; address++) { Wire.beginTransmission(address); returnCode = Wire.endTransmission(); if (returnCode == 0) { Serial.print("I2C device = "); M5.Lcd.printf("0X%X ", address); } } } delay(200); } }
-
RE: Atomic CAN Bus and Wifi
@kuriko
Indeed a strange situation.
It occurs if I use TX=26 and RX=32 and also TX=22 and RX=19 to initiate the can BUS on a M5Atom
ESP32Can.CANInit(); // Init CAN Module. 初始化CanIf i dont initiate WifI I can send data through the CAN BUS. The moment I initiate WiFi, no data come through in the CAN BUS.
I will do some other trials with other devices (M5Core 2 and M5Atom S3) to check if it is a hardware problem.
I do hope to get this solved because if this problem is definite it means the Communication abilites of the CAN bus are limited.
Regards(* Oh, important : When using WiFi i do receive CAN BUS messages , so that is weird, i really need to dive into this*)
-
RE: Atomic CAN Bus and Wifi
@kuriko I use Arduino.
I am curious if this is a hardware issue or software (incompatibility between Wifi and the CAN bus protocol).
It does not work with ports 26 and 32 as well as ports 22 and 19 for communication with the CAN bus port
Regards
-
Atomic CAN Bus and Wifi
I am running into the following problem.
The Atomic CAN Bus works perfect. When I include WiFi it does not send andy data anymore. I have tested this with both the CanBus base as well as with Can bus Unit.
Somehow I have the feeling that it is related to incompability between Serial 1 and/or Serial 2 and WiFi on an ESP32.
Any feedback/suggestions?
Thanks -
ATOM_SPK, no sound output
Dear all,
I am trying this device : https://shop.m5stack.com/products/atomic-speaker-base-ns4168 using the software from this link (https://github.com/m5stack/M5Atom/tree/master/examples/ATOM_BASE/ATOM_SPK/PlayRawPCM)This is the message i get when resetting the atom lite :
ets Jun 8 2016 00:22:57rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, 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:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
E (303) esp_core_dump_<V͡� Incorrect size of core dump image: 0
M5Atom initializing...OK
E (82) I2S: i2s_driver_uninstall(2048): I2S port 0 has not installed
E (83) I2S: i2s_check_set_mclk(253): ESP32 only support to set GPIO0/GPIO1/GPIO3 as mclk signal, error GPIO number:120
E (89) I2S: i2s_set_pin(314): mclk config failed
I2S WriteI know the software is running through some checks in the software i have build in.
But i do not here any sound. No beep at startup and no soumd when i press the button.
This function returns a false : _AtomSPK.begin()
The weird thing is that the definition is : bool ATOMSPK::begin(int __rate) but it is called without __rate defined.
Within the begin function the error occurs in : err += i2s_set_pin(SPAKER_I2S_NUMBER, &tx_pin_config);Any idea?
Thanks -
RE: M5stack GPS, use Serial2 and Serial1
@felmue said in M5stack GPS, use Serial2 and Serial1:
Well, now i need to recheck what i have been doing.
Your example works both on M5Stick (using ports 0 and 26) and M5Atom (ports 26 and 32).Thank you, i have some work to do, Ha Ha
-
M5stack GPS, use Serial2 and Serial1
This device : ATOMIC GPS Base (M8030-KT) uses Serial2 to communicate with the GPS chip.
Now i am trying to use Serial1.begin(19200, SERIAL_8N1, 32, 26) to communicate with another device.
I know that this device is working, i have tested it with master module.
I have also switche TX and RX ports. Still no respond from the slave.So i was wondering, is it possible to use Serial1 on M5atom lite with the 32 and 26 ports?
Thanks -
RE: CatM+GNSS module : cellular and GNSS simultanous incompatible ?
@HappyUser First tests seem to indication that in order to switch from data mode to GNSS mode, you need to power off the GNSS module. As a result, the GNSS forgets its position and it takes another 5 to 10 seconds to get updated position data again. Btw, during the whole operation the module is powered. we are open to smarter solutions for this problem.
-
RE: CatM+GNSS module : cellular and GNSS simultanous incompatible ?
@felmue Thanks,
And now i am really curious about the Ideas from the M5Stack engineers about a fast responding program that integrates MQTT and GNSS. We are also working on it now. -
CatM+GNSS module : cellular and GNSS simultanous incompatible ?
What should have been an easy switch from the regualr sim7089 module to the CatM+GNSS module (also based on SIM7080), ended up in some serious back to basic debugging.
This link (https://github.com/wottreng/SIM7080G-NB-IoT-Cat-M-LTE-GPS), mentions:
GPS/GNSS and cellular can not be used together. Causes module to hang and be unresponsiveWe are going to check whether that is the cause of our issue with this module.
Anyone else experience with this incompatibility.
Thanks -
RE: CatM+GNSS, how much power from port C
@felmue Thank you. Makes powering some mobile SIM7080 based projects a little easier. We will start some duration tests. Regards
-
CatM+GNSS, how much power from port C
Dear all,
Do we have any idea how much power can be provided by the port C (if module is powered externally obviously). Use case could be powering the controlling ESP with port C connection.
Thanks -
RE: M5Dial can not upload
On OSX i often have to unplug the usb cable in my laptop. Or even worse, switth from one usb to the other usb connector. Disturbing behaviour, but gotten used to it.
-
RE: ATOM Lite G26 / G32 for One Wire application
@Uzr66 It might be helpful if you share the code with us and elaborate a bit further.
-
RE: M5Dial, no wake up with button
Thanks to Felix.
I also tried his solution of removing the 5V pin from the M5Stamp, power down and wake up with button works perfectly. Even in combination with power timer sleep. Very low current. A big relief for us, save us a lot of time (and €) to find another solution for an unexpected behaviour. Many thanks to Felix!
Btw, you really have to cut the 5 volt pin short because otherwise it still makes contact.