danielblock1 / FestoolBluetooth

GNU General Public License v3.0
16 stars 3 forks source link

Atom crashes on every press of a button #1

Open yasapl opened 2 years ago

yasapl commented 2 years ago

I have compiled the script and uploaded to atom. I have also managed to pair the remote but on every button press the esp32 is crashing. Also the gpio 23 goes high and stays like that until hard reset is performed. See below the log.

`rst:0x1 ▒]I=9}IMQ▒,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:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Scanning... M5Atom initializing...OK Printing stored remote addresses: d3:a3:ab:xx:xx:xx Received Button click from: d3:a3:ab:xx:xx:xx Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x00000024 PS : 0x00060c30 A0 : 0x801648a0 A1 : 0x3ffc7970 A2 : 0x3ffc2438 A3 : 0x3ffc79d0 A4 : 0x3ffc7a40 A5 : 0x00000001 A6 : 0x00000024 A7 : 0x00000000 A8 : 0x80164614 A9 : 0x0000000a A10 : 0x00000001 A11 : 0x0000000a A12 : 0x3ffdba0c A13 : 0x3ffb7fbc A14 : 0x3ffc2438 A15 : 0x3ffc79d0 SAR : 0x00000020 EXCCAUSE: 0x00000014 EXCVADDR: 0x00000024 LBEG : 0x40090aad LEND : 0x40090abd LCOUNT : 0xffffffff

Backtrace:0x00000021:0x3ffc79700x4016489d:0x3ffc79d0 0x400d274a:0x3ffc7a70 0x400d2762:0x3ffc7ad0 0x400d9f0d:0x3ffc7af0

ELF file SHA256: 0000000000000000

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_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:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Scanning... M5Atom initializing...OK Printing stored remote addresses: d3:a3:ab:xx:xx:xx`

danielblock1 commented 2 years ago

Do you know how to do exception decoding in arduino?

On Mon, Mar 7, 2022 at 4:53 PM yasapl @.***> wrote:

I have compiled the script and uploaded to atom. I have also managed to pair the remote but on every button press the esp32 is crashing. Also the gpio 23 goes high and stays like that until hard reset is performed. See below the log.

`rst:0x1 ▒]I=9}IMQ▒,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:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Scanning... M5Atom initializing...OK Printing stored remote addresses: d3:a3🆎xx:xx:xx Received Button click from: d3:a3🆎xx:xx:xx Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x00000024 PS : 0x00060c30 A0 : 0x801648a0 A1 : 0x3ffc7970 A2 : 0x3ffc2438 A3 : 0x3ffc79d0 A4 : 0x3ffc7a40 A5 : 0x00000001 A6 : 0x00000024 A7 : 0x00000000 A8 : 0x80164614 A9 : 0x0000000a A10 : 0x00000001 A11 : 0x0000000a A12 : 0x3ffdba0c A13 : 0x3ffb7fbc A14 : 0x3ffc2438 A15 : 0x3ffc79d0 SAR : 0x00000020 EXCCAUSE: 0x00000014 EXCVADDR: 0x00000024 LBEG : 0x40090aad LEND : 0x40090abd LCOUNT : 0xffffffff

Backtrace:0x00000021:0x3ffc79700x4016489d:0x3ffc79d0 0x400d274a:0x3ffc7a70 0x400d2762:0x3ffc7ad0 0x400d9f0d:0x3ffc7af0

ELF file SHA256: 0000000000000000

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_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:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Scanning... M5Atom initializing...OK Printing stored remote addresses: d3:a3🆎xx:xx:xx`

— Reply to this email directly, view it on GitHub https://github.com/ntlord/FestoolBluetooth/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACASES3KCPSDK76UWWGIX3LU6Z3GNANCNFSM5QERT23A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

danielblock1 commented 2 years ago

Also try commenting out lines 110 and 114.

If that works, then something is messed up with the way you installed the M5 libraries.

On Mon, Mar 7, 2022 at 4:53 PM yasapl @.***> wrote:

I have compiled the script and uploaded to atom. I have also managed to pair the remote but on every button press the esp32 is crashing. Also the gpio 23 goes high and stays like that until hard reset is performed. See below the log.

`rst:0x1 ▒]I=9}IMQ▒,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:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Scanning... M5Atom initializing...OK Printing stored remote addresses: d3:a3🆎xx:xx:xx Received Button click from: d3:a3🆎xx:xx:xx Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x00000024 PS : 0x00060c30 A0 : 0x801648a0 A1 : 0x3ffc7970 A2 : 0x3ffc2438 A3 : 0x3ffc79d0 A4 : 0x3ffc7a40 A5 : 0x00000001 A6 : 0x00000024 A7 : 0x00000000 A8 : 0x80164614 A9 : 0x0000000a A10 : 0x00000001 A11 : 0x0000000a A12 : 0x3ffdba0c A13 : 0x3ffb7fbc A14 : 0x3ffc2438 A15 : 0x3ffc79d0 SAR : 0x00000020 EXCCAUSE: 0x00000014 EXCVADDR: 0x00000024 LBEG : 0x40090aad LEND : 0x40090abd LCOUNT : 0xffffffff

Backtrace:0x00000021:0x3ffc79700x4016489d:0x3ffc79d0 0x400d274a:0x3ffc7a70 0x400d2762:0x3ffc7ad0 0x400d9f0d:0x3ffc7af0

ELF file SHA256: 0000000000000000

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_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:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac Scanning... M5Atom initializing...OK Printing stored remote addresses: d3:a3🆎xx:xx:xx`

— Reply to this email directly, view it on GitHub https://github.com/ntlord/FestoolBluetooth/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACASES3KCPSDK76UWWGIX3LU6Z3GNANCNFSM5QERT23A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

yasapl commented 2 years ago

Hi, actually the RGB LED works perfectly fine - blue on pairing and then turn RED when pressing the remote button but then atom resets. I will figure out the exception decoding.

danielblock1 commented 2 years ago

It’s weird that it gets so far before it throws the exception. How familiar are you with coding?

If you have some familiarity, I would add debug statements using “Serial.println” to every line in the toggleVacuum function, and see which line it fails on.

On Mon, Mar 7, 2022 at 5:05 PM yasapl @.***> wrote:

Hi, actually the RGB LED works perfectly fine - blue on pairing and then flashes RED when pressing the remote button but then atom resets. I will figure out the exception decoding.

— Reply to this email directly, view it on GitHub https://github.com/ntlord/FestoolBluetooth/issues/1#issuecomment-1061184699, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACASES2X2AIB24276PGKH4LU6Z4S5ANCNFSM5QERT23A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

yasapl commented 2 years ago

Unfortunately I'm a "google search" coder - I can google code and solutions ;)

I have installed the exception decoder but I can't see any properly formatted exception in the serial console that I could decode.

Also, I'm not sure how can I add the Serial.printIn. I have tried to add Serial.println(RELAY_STATE) but it throws error during compilation

danielblock1 commented 2 years ago

Try replacing toggleVacuum with this:

void toggleVacuum() { Serial.println("toggleVacuum Called"); pBLEScan->stop(); Serial.println("toggleVacuum 1");

if (RELAY_STATE) { Serial.println("toggleVacuum 2");

digitalWrite(23, LOW);
Serial.println("toggleVacuum 3");

M5.dis.drawpix(0, 0x000000);
Serial.println("toggleVacuum 4");

RELAY_STATE = false;
Serial.println("toggleVacuum 5");

} else { Serial.println("toggleVacuum 6");

digitalWrite(23, HIGH);
Serial.println("toggleVacuum 7");

M5.dis.drawpix(0, CRGB::Red);
Serial.println("toggleVacuum 8");

RELAY_STATE = true;
Serial.println("toggleVacuum 9");

}

yasapl commented 2 years ago

Fails after RGB call.:

M5.dis.drawpix(0, CRGB::Red); Serial.println("toggleVacuum 8");

RELAY_STATE = true;

toggleVacuum Called toggleVacuum 1 toggleVacuum 6 toggleVacuum 7 toggleVacuum 8 toGuru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x00000024 PS : 0x00060e30 A0 : 0x8016491c A1 : 0x3ffc7970
A2 : 0x3ffc2438 A3 : 0x3ffc79d0 A4 : 0x3ffc7a40 A5 : 0x00000001
A6 : 0x00000024 A7 : 0x00000000 A8 : 0x80164690 A9 : 0x0000000a
A10 : 0x00000001 A11 : 0x0000000a A12 : 0x3ffdb9c4 A13 : 0x3ffb7fbc
A14 : 0x3ffc2438 A15 : 0x3ffc79d0 SAR : 0x00000020 EXCCAUSE: 0x00000014
EXCVADDR: 0x00000024 LBEG : 0x40090aad LEND : 0x40090abd LCOUNT : 0xffffffff

danielblock1 commented 2 years ago

Ok add above RELAY_STATE = true the following line:

Serial.println(RELAY_STATE);

danielblock1 commented 2 years ago

Also, if you click on "tools", what board do you have selected?

yasapl commented 2 years ago

I have selected M5Stack Atom

It prints status 0 and then crashes:

toggleVacuum Called toggleVacuum 1 toggleVacuum 6 toggleVacuum 7 toggleVacuum 8 0 Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x00000024 PS : 0x00060e30 A0 : 0x8016496c A1 : 0x3ffc7970
A2 : 0x3ffc2438 A3 : 0x3ffc79d0 A4 : 0x3ffc7a40 A5 : 0x00000001
A6 : 0x00000024 A7 : 0x00000000 A8 : 0x801646e0 A9 : 0x0000000a
A10 : 0x00000001 A11 : 0x0000000a A12 : 0x3ffd10d4 A13 : 0x3ffb7fbc
A14 : 0x3ffc2438 A15 : 0x3ffc79d0 SAR : 0x00000020 EXCCAUSE: 0x00000014
EXCVADDR: 0x00000024 LBEG : 0x40090aad LEND : 0x40090abd LCOUNT : 0xffffffff

yasapl commented 2 years ago

I have commented out the Atom library and everything related to it (M5) and it is still crashing the same way Added below lines:

/M5.dis.drawpix(0, CRGB::Red);/ Serial.println("toggleVacuum 8");

Serial.println(RELAY_STATE); Serial.println("toggleVacuum pre9"); Serial.println("toggleVacuum pre9.1"); Serial.println("toggleVacuum pre9.2"); /RELAY_STATE = true;/ Serial.println("toggleVacuum 9"); }

And it crashes usually just after Serial.println(RELAY_STATE); but sometimes it will even reach the pre9.2

It must be something else.

As an experiment I have loaded this sketch to a regular ESP32 devkit v1 board, connected the rgb to pin 27 and the button to pin g39. Blue light flashing correctly but I did not succeed pairing the remote but the device is crashing the same way.

There is another guy on festool owners group which has similar crashing issues.I have commented below his post then I have created the issue here.

yasapl commented 2 years ago

any chance you could send me your precompiled binary so I could try it?

danielblock1 commented 2 years ago

Sure. For whatever reason, I couldn't upload to github. Try this:

https://www.file.io/nPCy/download/pK8HLhKWuUf7

I have some brand new devices too. So I'll give it a shot on my own too

danielblock1 commented 2 years ago

FYI. I just tried it on my computer with a brand new atom and festool remote, and it worked. So that leads me to think it may be a library version issue. Try my binary version first. FYI, you'll need esptool to make that work.

yasapl commented 2 years ago

100% success with your binary! It must be the libraries then. Strange as I have installed fresh Arduino with all libraries as per M5Stack reference guide. Do you have any idea how can I check these?

Also, I'm using ESPHome project (part of Home Assistant) and used ESPHome Flasher to upload the binary. Much simpler than the python tool if you have no python installed :)

danielblock1 commented 2 years ago

I'm glad that it worked. Would you mind posting on the festool forum what you did?

I'm going to look if there is an easy way for us to check libraries. Honestly, for most, the ESPHome flasher is probably easier anyway.

I also saw you asked about the 433mhz thing. I think it would be possible, using this module: https://shop.m5stack.com/products/rf-unit-433mhz-receiver-syn513r

You could also likely roll your own module. I've done one project with 433mhz several years ago (emulating a ceiling fan controller). It should be possible to do what you want, but it isn't necessarily easy. Assuming you don't know the specifics of the signal the remote is sending, you'd likely need a cheap SDR to capture it and decode it. Most likely it is using ASK, since that's what most remotes use (but you should be able to verify that using the FCC report on the remote).

What 433mhz remote are you using? I've also considered the load idea too, but from what I understand the vaccuum needs several amps to trigger. What kind of capacitor, specifically, are you using? Also, why do you even need the 433mhz remote anymore, can't you just have the atom drive the relay of the load?

yasapl commented 2 years ago

Sure, I will post it.

I'm using cheap 433mhz remote relay (with two remotes), similar to the below: https://www.google.com/search?q=433+remote+relay&rlz=1C1GCEU_en-gbIE996IE996&sxsrf=APq-WBv1WAJvA40PPW17hxqbVQC0Bip6Fw:1647015524105&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjRxYP6ur72AhU1Q0EAHTS7BbwQ_AUoAXoECAEQAw&biw=1920&bih=947&dpr=1#imgrc=HeT6ZJo6TtkyYM

It connects the 20uF motor running capacitor (230V country) to the power takeoff socket of CTL Mini and this is enough to trigger the vac. I have not checked it but understand that it does not draw much power and works perfectly fine.

Now I want to add the festool remote to the game and with my current knowledge I can only add second relay in parallel to the 433mhz to trigger the same cap. Please note that I have not used the remote socket from m5Stack, just the atom and an external relay driven by gpio g23.

I also have couple of 433mhz receiver modules but have no knowledge how to add the code to trigger the relay with both bt (festool) and 433mhz remote using single atom module. I can easily achieve this in ESPHome as there is a module for decoding remote signals easily but it does not translate to the "normal" code.

I think my solution will be two separate relay modules for now until (if ever) I learn how to do this in on single module :)

Thank you for all your help.

Question: Are you OK for me to share the link to your binary in FOG?

danielblock1 commented 2 years ago

Totally fine with you sharing.

In terms of your remote. Why not totally dump the 433mhz remote entirely? Hook up the atom to a relay (like you intend), and have that relay switch your load, then just use festool remotes going forward?

You could also use something like this, which has the relay built in: https://shop.m5stack.com/products/atom-hub-switch-kit

yasapl commented 2 years ago

Going all Festool is a great idea... just more expensive, especially for a hobbyist like me ;). I have couple of areas in the workshop where I would like to keep my remotes to trigger the central ctl mini (bandsaw, sanders, cnc). I think I will stick for now with both and eventually get more festool remotes when my old 433mhz ones die.

Other option would be to create current sensing circuits in power sockets and trigger the vac that way - but this might be a project for the future.

danielblock1 commented 2 years ago

I’m guessing you could just find a cheaper Bluetooth remotes if it’s just a cost issue. As long as they transmit something when you press a button, it wouldn’t be super difficult to get it to work with my code.

yasapl commented 2 years ago

good idea with cheap bt remotes.

Would you be able to do me a favour and reverse the logic on g23 and recompile again? It turns out my relay activates on low and this means it would have to be energized when vac is off. Or maybe set another pin on atom with reverse logic (g33?). this would work for everyone.

Thanks in advance!

danielblock1 commented 2 years ago

Sure. I made 33 opposite, like you suggest

https://www.file.io/ZbWd/download/EQej7orrI17m

danielblock1 commented 2 years ago

Actually, try this one instead (I made it default to HIGH on powerup):

https://file.io/YUVz7VmRSEFx

yasapl commented 2 years ago

thank you! Tried both and no change, g23 starts low and in the first one g33 does not change state.

I would love to be able to compile these myself. Any chance you could zip and share your arduino libraries? ;)

yasapl commented 2 years ago

ok, did the factory reset and got it running fine on the first one which I prefer as now I can drive led indicator on g23 as well. Thank you for all your help! Still if you are willing to share libs I will be even happier.

Micklydie commented 3 months ago

Hello,

i’m facing the same problem as yasapl. Could you please post the latest version of your binary? The link on file.io doesn’t work any more. Many thanks. Mickael

yasapl commented 3 months ago

Hello,

i’m facing the same problem as yasapl. Could you please post the latest version of your binary? The link on file.io doesn’t work any more. Many thanks. Mickael

Hi Mickael,

You can find a copy of these binaries in my fork (https://github.com/yasapl/FestoolBluetooth)

Micklydie commented 3 months ago

Hello, Thanks for your quick answer!

Is the file "FestoolBluetooth.ino" the new and working one? Thiis file ist still not working in my environment :-(

I'm looking for the not compiled project (not the ino.bin) because I want to use output 26 instead of 23.

Thanks for your help. WBR. Mickael

danielblock1 commented 3 months ago

Hi all, I’ve sort of abandoned this project as I got a new dust collector with bt built in a year ago or so. That said, I will try to fix it when i have time, I’ve just been swamped with other work.

On Tue, Aug 6, 2024 at 7:47 AM Micklydie @.***> wrote:

Hello, Thanks for your quick answer!

Is the file "FestoolBluetooth.ino" the new and working one? Thiis file ist still not working in my environment :-(

I'm looking for the not compiled project (not the ino.bin) because I want to use output 26 instead of 23.

Thanks for your help. WBR. Mickael

— Reply to this email directly, view it on GitHub https://github.com/danielblock1/FestoolBluetooth/issues/1#issuecomment-2271097569, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACASES3437JGGGDACHAO4BLZQCZWVAVCNFSM6AAAAABMBC6MJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRGA4TONJWHE . You are receiving this because you commented.Message ID: @.***>

Micklydie commented 3 months ago

Hello and thsnks again for your response. I understand your point.

But it seems to be, that you've found the solution with yasapl. Don't waste your time with debugging this programm, if poissible I only would like to have the latest version of your not compiled project (it seems be working) so that I can try to fix and modify it by myself :-)

Thanks a lot. Mickael

danielblock1 commented 3 months ago

Whatever I have on GitHub is my latest program. Like obviously it did work for me, but I must have messed something up right before I uploaded it. But it’s been so long I don’t have any previous versions that work.

On Tue, Aug 6, 2024 at 7:55 AM Micklydie @.***> wrote:

Hello and thsnks again for your response. I understand your point.

But it seems to be, that you've found the solution with yasapl. Don't waste your time with debugging this programm, if poissible I only would like to have the latest version of your not compiled project (it seems be working) so that I can try to fix and modify it by myself :-)

Thanks a lot. Mickael

— Reply to this email directly, view it on GitHub https://github.com/danielblock1/FestoolBluetooth/issues/1#issuecomment-2271110084, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACASESZTJDWULHLV7SYR6KTZQC2RZAVCNFSM6AAAAABMBC6MJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRGEYTAMBYGQ . You are receiving this because you commented.Message ID: @.***>