@HappyUser Found it in the Meshtastic app on OSX under device settings. Btw, IOS app does not allow for tcp connections as it seems.
Posts made by HappyUser
-
RE: M5Stack C6L: Meshtastic change roleposted in Units
-
M5Stack C6L: Meshtastic change roleposted in Units
Hi,
Maybe I am blind, or maybe I have misread something, but I don't see the possibility to change the role from client to something else. Nor in the OSX webbrowser nor in the IOS Meshtastic app.
Any idea?. Thanks -
RE: Seeking for a specific unit, .. any ideasposted in Units
@felmue Thanks and sorry for my late response, been away.
yes , thanks for the reminder, we are ware of the difference and managed to find the best (at least what we think) SIM modules for our applications.
We prefer to stick to a few brands for ESP32, M5Stack is one of them, it might limit us, but it also challenges us to come up with solutions.What we are testing now is using different serials by restarting the device ans select based on an identifier which port to use. Has some serious energy considerations, but it might turn out to be the best way because we can stick to preselected master devices (which inded limit #Serials). Regards
-
Seeking for a specific unit, .. any ideasposted in Units
Hi, In order to streamline our IOT equipment portfolio, I am seeking for a module that combines :
1] ESP 32 with WiFi
2] A mobile connection for MQTT (for example a SIM76 family)
3] Two Serial ports available : Serial1 and Serial2This one looks great : IoT Base CatM but it seems that 1 Serial is used by the SIM module.
The same appear to go for this module : Atom DTU NBIoT2Any suggestions how to combine a SIM76 family (or any other mobile chip), with the availability of Serial1 and Serial2?
Thanks for your creativity. -
RE: M5Unit C6L Lora initialisation errorposted in Units
@felmue said in M5Unit C6L Lora initialisation error:
here
thank you for figuring that out. Honestly, i would have expected that that would be dealt with in M5Unified. Anyway, module works great. Cam right on time on the market because we really need to upgrade our iot devices in the field.
-
RE: M5Unit C6L Lora initialisation errorposted in Units
@HappyUser Well, solved it. Updated M5GFX to 0.2.19 did the trick. What makes me wonder is how tis update is related to a communication issue with the LoRa chap.
-
RE: M5Unit C6L Lora initialisation errorposted in Units
@HappyUser
These are the libs that I am using. Could it be that somehow there is a difference with your config?
Multiple libraries were found for "SPI.h"
Used: /Users/..../Library/Arduino15/packages/m5stack/hardware/esp32/3.2.5/libraries/SPI
Not used: /Users/....../Library/Arduino15/packages/m5stack/hardware/esp32/3.2.5/libraries/_DontUse_SPI
Using library RadioLib at version 7.3.0 in folder: /Users/....../Documents/Arduino/libraries/RadioLib
Using library SPI at version 3.2.1 in folder: /Users....../Library/Arduino15/packages/m5stack/hardware/esp32/3.2.5/libraries/SPI
Using library M5Unified at version 0.2.13 in folder: /Users/....../Documents/Arduino/libraries/M5Unified
Using library M5GFX at version 0.2.15 in folder: /Users.../Documents/Arduino/libraries/M5GFX
/Users/....../Library/Arduino15/packages/m5stack/tools/esp-rv32/2411/bin/riscv32-esp-elf-size -A /Users/..../Library/Caches/arduino/sketches/E220783385D73AB555D51793968410FB/LoRa_Test.ino.elf
Sketch uses 434305 bytes (33%) of program storage space. Maximum is 1310720 bytes.
Global variables use 17508 bytes (5%) of dynamic memory, leaving 310172 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port /dev/cu.usbmodem1101:
Connecting...
Connected to ESP32-C6 on /dev/cu.usbmodem1101:
Chip type: ESP32-C6 (QFN40) (revision v0.2)
Features: Wi-Fi 6, BT 5 (LE), IEEE802.15.4, Single Core + LP Core, 160MHz
Crystal frequency: 40MHz
USB mode: USB-Serial/JTAG
MAC: 58:8c:81:ff:fe:50:00:08
BASE MAC: 58:8c:81:50:00:08
MAC_EXT: ff:fe -
RE: M5Unit C6L Lora initialisation errorposted in Units
@felmue Thank you. I tried this extra spi call because I assumed that something is wrong with SPI. Leaving out this call does not solve the problem either. Bot M5Unified and and radiolib are updated. M5Stack board manager is also updated. This is very weird. Not sure how to process further.
-
RE: M5Unit C6L Lora initialisation errorposted in Units
I receive this debug error message : GPIO pre-transfer timeout, is it connected? which is located in in the function
int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write, const uint8_t* dataOut, uint8_t* dataIn, size_t numBytes, bool waitForGpio)
in the file Module.cppI am using the example in this M5Stack link : https://docs.m5stack.com/en/arduino/unit_c6l/lora
Help is appreciated.
Regards -
M5Unit C6L Lora initialisation errorposted in Units
Hi, I am using the following program to test Lora on this model. However, i receive this error: [SX1262] Initializing... Failed, code: -2. I assume that i am using the correct ports as given in rthe documentation. Any suggestions ? Thanks ```
#include <RadioLib.h>
//#include <arduino.h>
#include <M5Unified.h>
#include <SPI.h>// SX1262: CS, IRQ, NRST, BUSY
SX1262 radio = new Module(23, 7, RADIOLIB_NC, 19);bool receiveFlag = false; // flag to indicate that a packet was received
// function to be called when a complete packet is received
void setFlag(void) {
receiveFlag = true;
}#define LORA_MISO 22 //38 //19
#define LORA_MOSI 21 //23
#define LORA_SCLK 20 //18void setup() {
// auto cfg = M5.config();
// M5.begin(cfg);Serial.begin(115200);
M5.begin();
delay(1000);Serial.println("And we have started");
if (SPI.begin(LORA_SCLK, LORA_MISO, LORA_MOSI,-1)) // SCK, MISO, MOSI, SS { Serial.println("Fine"); M5.Display.print("SPI is fine"); } else { Serial.println("Not fine"); M5.Display.print("SPI ERROR"); }auto& ioe = M5.getIOExpander(0);
ioe.digitalWrite(7, false);
delay(100);
ioe.digitalWrite(7, true); // re-enable SX_NRST
ioe.digitalWrite(6, true); // enable SX_ANT_SW
ioe.digitalWrite(5, true); // enable SX_LNA_EN// initialize SX1262
Serial.print("\n[SX1262] Initializing... ");
// frequency MHz, bandwidth kHz, spreading factor, coding rate denominator, sync word,
// output power dBm, preamble length, TCXO reference voltage, useRegulatorLDO
int beginState = radio.begin(868.0, 125.0, 12, 5, 0x34, 22, 20, 3.0, true);
if (beginState == RADIOLIB_ERR_NONE) {
Serial.println("Succeeded!");
} else {
Serial.print("Failed, code: ");
Serial.println(beginState);
while (true) { delay(100); }
}// set the function to be called when a new packet is received
radio.setPacketReceivedAction(setFlag);// start listening for LoRa packets
Serial.print("[SX1262] Starting to listen... ");
int receiveState = radio.startReceive();
if (receiveState == RADIOLIB_ERR_NONE) {
Serial.println("Succeeded!");
} else {
Serial.print("Failed, code: ");
Serial.println(receiveState);
while (true) { delay(100); }
}
}void loop() {
if (receiveFlag) { // check if a new packet is received
receiveFlag = false; // reset the flagString str; // read the received data as an Arduino String int readState = radio.readData(str); if (readState == RADIOLIB_ERR_NONE) { // packet was received successfully Serial.println("\n[SX1262] Received packet!"); Serial.print("[SX1262] Data: "); Serial.println(str); Serial.print("[SX1262] RSSI: "); Serial.print(radio.getRSSI()); // Received Signal Strength Indicator Serial.println(" dBm"); Serial.print("[SX1262] SNR: "); Serial.print(radio.getSNR()); // Signal-to-Noise Ratio Serial.println(" dB"); Serial.print("[SX1262] Frequency error: "); Serial.print(radio.getFrequencyError()); Serial.println(" Hz"); } else if (readState == RADIOLIB_ERR_CRC_MISMATCH) { // packet was received but malformed Serial.println("CRC error!"); } else { // some other error occurred Serial.print("Failed, code: "); Serial.println(readState); }}
} -
Tab5, LVGL, trying to get touch workingposted in Cores
Solved: somehow commented the lv_tick_inc(5); in the main loop.
Hi, I m trying to get touch working together with lvgl 8.3. I believe the code is not working. Any suggestions? ```
#include <arduino.h>
#include <M5GFX.h>
#include <M5Unified.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <esp_now.h>
#include <lvgl.h>
#include <M5GFX.h>M5GFX display;
#define LVGL_LCD_BUF_SIZE (Screen_Width * Screen_Height)
// lvgl variables
static lv_disp_drv_t disp_drv;
static lv_disp_draw_buf_t draw_buf;
static lv_color_t *buf;// UI objects
lv_obj_t * screen;void lv_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
//M5.Display.pushImageDMA(area->x1, area->y1, w, h, (uint16_t *)&color_p->full);
display.pushImageDMA(area->x1, area->y1, w, h, (uint16_t *)&color_p->full);
lv_disp_flush_ready(disp);
}// touch callback
static void lv_indev_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
{
lgfx::touch_point_t tp[3];
// uint8_t touchpad = M5.Display.getTouchRaw(tp,3);
uint8_t touchpad = display.getTouchRaw(tp,3);
if (touchpad > 0)
{
data->state = LV_INDEV_STATE_PR;
data->point.x = tp[0].x;
data->point.y = tp[0].y;
Serial.printf("X: %d Y: %d\n", tp[0].x, tp[0].y); //for testing
}
else
{
data->state = LV_INDEV_STATE_REL;
}
}void setup() {
//auto cfg = M5.config();
//M5.begin(cfg);
//M5.Display.startWrite();
//M5.begin();
Serial.begin(115200);
delay(300);Serial.println("And we have started"); display.init(); lv_init(); buf = (lv_color_t *)heap_caps_malloc(sizeof(lv_color_t) * LVGL_LCD_BUF_SIZE, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); lv_disp_draw_buf_init(&draw_buf, buf, NULL, LVGL_LCD_BUF_SIZE); // set up display driver lv_disp_drv_init(&disp_drv); disp_drv.hor_res = Screen_Width; disp_drv.ver_res = Screen_Height; disp_drv.flush_cb = lv_disp_flush; disp_drv.draw_buf = &draw_buf; disp_drv.sw_rotate = 1; disp_drv.rotated = LV_DISP_ROT_90; lv_disp_drv_register(&disp_drv); // initialise touch static lv_indev_drv_t indev_drv; lv_indev_drv_init(&indev_drv); indev_drv.type = LV_INDEV_TYPE_POINTER; indev_drv.read_cb = lv_indev_read; lv_indev_drv_register(&indev_drv);}
void loop() {
lv_timer_handler();
delay(5);}
-
RE: M5Atom Matrix, M5Unfied, controlling ledsposted in Atom
@felmue thanks. Indeed. Leaving out m5unified does the trick. Though I haven’t read anything about an incompatibility between M5Unified and FastLed. Regards.
-
M5Atom Matrix, M5Unfied, controlling ledsposted in Atom
Hi am stumped,
I just can't control the leds anymore.
This is my code, no led goes on.
Any suggestion where I am going terrible wrong?#include <arduino.h> #include <M5Unified.h> #include <FastLED.h> #define NUM_LEDS 25 #define DATA_PIN 27 #define CLOCK_PIN 13 CRGB leds[NUM_LEDS]; void setup() { auto cfg = M5.config(); cfg.serial_baudrate = 115200; cfg.output_power = true; M5.begin(cfg); //FastLED.addLeds<WS2812, DATA_PIN,GRB>(leds, NUM_LEDS); // GRB ordering is assumed FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); for (int i=0;i<NUM_LEDS;i++) {leds[i]=CRGB::Red;};FastLED.show(); } -
RE: Tab 5, how to enable Lora?posted in PRODUCTS
@easytarget thank you. That is indeed an option. In my experience not to much work to get a Lora module working. We have a number of them in the field. But we would like the tab5 not become thicker as it is. We are now considering to place an Heltec Lora inside. Maybe that could work. Regards.
-
RE: Tab 5, how to enable Lora?posted in PRODUCTS
@felmue Thank you, that makes sense. Btw, a great product.
-
Tab 5, how to enable Lora?posted in PRODUCTS
It appears that the tab5 is prepared to work with Lora. Any idea how?
Thanks -
RE: Trying to get this LoRa Module working on Core2posted in Modules
@felmue Dear Felix,
Actually, we have done nearly the same thing.
We have connected this module: HopeRF RFM95W to the connectors on the back of the Core2. That works great.
We have no idea why the LoRa module does not work with the Core2. Maybe a SPI conflict somewhere deep in the background, maybe a power issue or maybe, and more likely, we are lacking some understanding.
Anyway, we have decided to use a Proto board, solder the LoRa module on it and place that on the backside of the Core2.
We have to do that for 35 devices, but it is fail save.
Thanks for all the effort
Regards -
RE: Trying to get this LoRa Module working on Core2posted in Modules
@felmue Thank you.
We are struggling really hard with the M5Unified library. We tried getting things working using startwrite and endwrite at the correct places, and also without using (as you suggested). The problems that we are facing is that sometimes the display lights up after a restart and sometimes it does not. We dont believe it is a faulty device because we se it happening with different M5Core2.We are diving into it. Maybe i will make a new post discribing the problems (and hopefuly solutions) that we are facing with M5Unified.
For now, we dont dare to update our devices in the field because there is no turning back.
Regards -
RE: Trying to get this LoRa Module working on Core2posted in Modules
@felmue Thank you.
Pins are assigned correctly. Double checked.
Not shown but this piece of codeauto cfg = M5.config(); cfg.serial_baudrate = 115200; cfg.output_power = true; cfg.led_brightness=180; M5.begin(cfg); M5.Power.begin();``` Handles the power. Tested out : if we remove M5.Display.startWrite(); then Lora.begin works great. However, we need to startup the display also. So, I strongly beleive there is some interference with SPI and startWrite(). No idea how. Regards Regards -
Trying to get this LoRa Module working on Core2posted in Modules
/*
After some further trial and error and comparison of what works and what not works.
In this piece of code :auto cfg = M5.config(); cfg.serial_baudrate = 115200; cfg.output_power = true; M5.begin(cfg); M5.Power.begin(); M5.Display.startWrite();The problem starts with M5.Display.startWrite(); If we remove that one, LoRa.begin(LORA_FREQ)) works fine.
So I assume that there is some kind of SPI conflict.
Then the next question is : i need to keep both the startwrite because i use M5Unified and I wnat to connect to the Lora module.Is this info a better pointer to find a solution?
Thanks*/
Hi,
We are trying to get this LoRa module : ```
https://docs.m5stack.com/en/module/lora868working in a M5Core2. We realize that this module is no longer supported. But we have a lot of them operational in the field, and for several reasons we need to upgrade from M5Stack the grey on to M5Core2. I have included our testing code. We are using the M5_SX127X.h which works great with the M5Stack grey one. We also updated the pins to the Core2 (when the LoRa module is stcked on the Core 2. This piece of code tells us that SPI is started:if (SPI.begin(LORA_SCLK, LORA_MISO, LORA_MOSI,-1)) // SCK, MISO, MOSI, SS { Serial.println("Fine");} else {Serial.println("Not fine");}We are not sure about this one : LoRa.setSPIFrequency(300000); // Not sure , we tried different values also left this out, to no avail. The software hangs inside this call LoRa.begin(LORA_FREQ) , which looks like the SPI transmission with the LoRa device hangs. But we have no idea. Double checked the pin assignments, we beleive they are correct. Anyone a suggestion how to get this LoRa module working on an M5Core2? Thanks However,#include <arduino.h>
#include <M5Unified.h>
#include <SPI.h>
#include "M5_SX127X.h"#include <Wire.h> //The DHT12 uses I2C comunication.
#include <WiFi.h>
#include <WiFiClient.h>#include <WiFiMulti.h>
#include <HTTPClient.h>#include <EEPROM.h>
#define EEPROM_SIZE 1
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS GPIO_NUM_26 //9
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);// Module Connect Pins Config
// Core
/*
#define CS_PIN 5
#define RST_PIN 26 //13
#define IRQ_PIN 36 //34#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_SCLK 18
*/
// Core2
#define CS_PIN 33 //5
#define RST_PIN 25 //26 //13
#define IRQ_PIN 36 //36 //36 //34#define LORA_MISO 38 //19
#define LORA_MOSI 23 //23
#define LORA_SCLK 18 //18// LoRa Parameters Config
// #define LORA_FREQ 433E6
#define LORA_FREQ 868E6
#define LORA_SF 12
#define LORA_BW 125E3
#define LORA_TX_POWER 17/*
// Module Connect Pins Config
#define CS_PIN 5
#define RST_PIN 13
#define IRQ_PIN 34#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_SCLK 18// LoRa Parameters Config
// #define LORA_FREQ 433E6
#define LORA_FREQ 868E6
#define LORA_SF 12
#define LORA_BW 125E3
#define LORA_TX_POWER 17
*///**************************** LoRa
int packetSize;
int LoRa_Pulse_Count_Max=0; // Om de WindGust te bepalen
int LoRa_Counter_Cumm=0;
int LoRa_Windspeed_Counter=0;
float LoRa_Windspeed_Avg=0;float LoRa_Outside_Temperature;
int LoRa_Pulse_Count;
float LoRa_Wind_Speed;
float LoRa_WindGust;const int LoRa_Pulse_Array_size= 400; // inschatting
int LoRa_Pulse_Array[LoRa_Pulse_Array_size];const long Ten_Minutes=600000;
long Next_Ten_Minutes;typedef struct {
int SecretCode;
int Pulse_Count;
int CallCounter;
//float Current;
//float Voltage;
float tempC;} LoRa_Receive_struct;
LoRa_Receive_struct LoRa_Receive_Data;//***************************** End of LoRa
void setup() {
Serial.begin(115200);
//pinMode(CS_PIN,OUTPUT);
//pinMode(RST_PIN,OUTPUT);
Serial.println("LoRa Receiver");
if (SPI.begin(LORA_SCLK, LORA_MISO, LORA_MOSI,-1)) // SCK, MISO, MOSI, SS
{ Serial.println("Fine");} else {Serial.println("Not fine");}
LoRa.setSPI(&SPI);
LoRa.setPins(CS_PIN, RST_PIN, IRQ_PIN); // set CS, reset, IRQ pin
LoRa.setSPIFrequency(300000); // Not sure , we tried different values
while (!LoRa.begin(LORA_FREQ)) {
Serial.println("LoRa init fail.");
delay(1000);
}
Serial.println("Seems okay");//LoRa.setTxPower(LORA_TX_POWER); //LoRa.setSignalBandwidth(LORA_BW); //LoRa.setSpreadingFactor(LORA_SF);}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");
LoRa.readBytes((uint8_t *)&LoRa_Receive_Data, packetSize);
if (LoRa_Receive_Data.SecretCode==5498)
{Serial.print("LoRa :"); Serial.print(LoRa_Receive_Data.tempC); Serial.print(" | "); Serial.println(LoRa_Receive_Data.Pulse_Count); }/*
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
*/
// print RSSI of packet
Serial.print("with RSSI ");
Serial.println(LoRa.packetRssi());
}
}