Xiaomi Mi Temperature Humidity Sensor (MJ_HT) + ESP32 + Blynk

i can’t read sensör

image

i can’t connect

I can’t understand!

Pete.

it’s harder for me

image

You’ve posted some screenshots, one that seems to show that you have chosen a partition with 2MB of space allocated to SPIFFS, when the app doesn’t use SPIFFS, so this is wasted memory.

You’ve also posted a screenshot of your serial monitor output, but not provided any information about whether your Xiaomi device is visible in nRF Connect and whether you’ve used your device’s MAC address in your version of the sketch.

It’s almost impossible to help you if you simply post random things like “I can’t read sensor” or “I can’t connect” without providing any background information regarding what other steps you’ve taken.

If this is a language issue then post the information in your native language and we’ll use an online translator, but at least post the relevant information in some way rather than random one line comments.

Pete.

1 Like

I am lost , I can’t help :joy:

:slight_smile:

Hello,
I receive the following output, when running the code:

12:32:11.402 → Starting MJ client…
12:32:13.639 → - Created client
12:32:13.639 → =================== Forming a connection to Flora device ====================
12:32:13.639 → a4:c1:38:73:1b:82
12:32:13.639 → - Connection to MJ
12:32:16.479 → on connect
12:32:16.479 → - Connected to MJ
12:32:18.987 → Failed to find our service UUID: a4e35a64-9e09-11ec-b909-0242ac120002
12:32:18.987 → - Found our service
12:32:18.987 → Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.
12:32:18.987 → Core 1 register dump:
12:32:18.987 → PC : 0x400d5846 PS : 0x00060530 A0 : 0x800d1809 A1 : 0x3ffceea0
12:32:19.034 → A2 : 0x00000000 A3 : 0x7bb5474d A4 : 0x3ffc6180 A5 : 0x11ecb909
12:32:19.034 → A6 : 0x5a649e09 A7 : 0x0001a4e3 A8 : 0x800d8828 A9 : 0x3ffceec0
12:32:19.034 → A10 : 0x00000002 A11 : 0x3f40191b A12 : 0x3ffcef14 A13 : 0x3ffcee54
12:32:19.034 → A14 : 0x3ffcee18 A15 : 0x3f41dd38 SAR : 0x00000010 EXCCAUSE: 0x0000001c
12:32:19.034 → EXCVADDR: 0x00000034 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
12:32:19.034 →
12:32:19.034 → Backtrace: 0x400d5846:0x3ffceea0 0x400d1806:0x3ffcef00 0x400d18cc:0x3ffcef50 0x400d71a5:0x3ffcef70 0x400d1986:0x3ffcef90 0x400d8f0d:0x3ffcefb0 0x4008e689:0x3ffcefd0
12:32:19.079 →
12:32:19.079 → Rebooting…
12:32:19.079 → ets Jun 8 2016 00:22:57
12:32:19.079 →
12:32:19.079 → rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
12:32:19.079 → configsip: 0, SPIWP:0xee
12:32:19.079 → clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
12:32:19.079 → mode:DIO, clock div:1
12:32:19.079 → load:0x3fff0018,len:4
12:32:19.079 → load:0x3fff001c,len:1044
12:32:19.079 → load:0x40078000,len:8896
12:32:19.079 → load:0x40080400,len:5816
12:32:19.079 → entry 0x400806ac

On the sensor, I see that there is some kind of connection but no data is shown in serial monitor. Also the connection to Blynk does not work.

MAC addrress is correct but I am not sure what to do regarding the UUID.

Any idea what went wrong here? Thanks in advance!

What version of the ESP32 core are you using?

If it’s 2.x.x then I’d try down-grading to 1.0.6 or earlier.

This type of error usually occurs when you try to do string to char conversions and the string is longer than the char variable is expecting.

Pete.

thanks for the swift reply. Can you please let me know how to check and do the downgrade?

Tools > Board > Boards Manager > search for ESP32

Pete.

1.0.6 is installed:

issue is still the same

partition sheme is set to the following values:

Hello @Jannik

Regarding the partition scheme, even if I don’t think it’s the real issue, you can try to reduce upload speed.

It looks like it crashes when it tries to find the service UUID. You shouldn’t need to change Service UUID from the original sketch to make it work, why you changed it ?

Hello @kaosss ,
I tried using the UUID of the temperature sensor. But even if I use the UUID you provided, I’ll receive the same errore message.
Upload speed is set to the lowest value:
grafik

Any further ideas? Thanks for your support!

Read again for the upload speed :slight_smile:
The UUID is probably the issue, can you post a picture/link of the sensor you use ?

Sorry. Read to fast. Will check the upload speed later on. But I don’t think that will be the issue. We’ll, let’s see
I’m using this sensor

I changed the upload speed to 115200 - same result

btw… is there a particular reason why this time attribute is set to such a high value?

  Serial.begin(115200);
  Serial.println("Starting MJ client...");
  delay(500);
  BLEDevice::init("");
  pClient  = BLEDevice::createClient();
  delay(500);
  **timer.setInterval(60000L, getSensorData1);** 

if I leave it like this it will take quite a long time until anything happens. Using a shorter value, such as 600L will give me instant results in Serial Monitor, but nevertheless the mentioned error message appears

It’s a Xiaomi Bluetooth sensor
are you sure of UUID and MJ adress ?
Did you change the xiaomi firmware ?