buzzing mindfulness bracelet code plus some new functions

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

Yes, coming out of deep sleep does a powerup of the MCU, which means that the CircuitPython runtime restarts and goes through the boot process (executing boot.py, etc). That's the thing with a deep sleep... the chip is powered down to save as much as possible.

You could flip the logic of the mode switch so that you need to hold it pressed to write to CIRCUITPY from the PC. That way it will come up able to write to the drive from CP normally.

Dave

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

Flipping the logic sounds great.
Is this the code I have to change in the BOOT.PY file?

Code: Select all

switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
Should I write “Pull.DOWN” instead of “Pull.UP”?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

No, that part is good. Negate the switch value for remounting:

Code: Select all

storage.remount("/", not switch.value)
Dave

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

Update after a while:
finally I received the bluetooth board. However... the Italian company I purchased from sent me the wrong board: I had ordered a QY PY ESP32-S3 but they delivered an ESP32-C3 instead.
Besides the courier threw the package in my garden and my dog chew at it and broke the stemma connector (which I don’t need) and apparently nothing else.
Today I soldered the circuit and powered it up and noticed the following issues:
1) my pc does not see the board unless it is already powered by the battery and even in that case does not recognize it.
2) the battery doesn’t get charged through the BFF when the board is plugged to the pc (this time I put the boards side to side and I’ve only connected the ground and 5v pins as you suggested).

I’ve seen the C3 doesn’t have native USB and was wandering if this is the reason...

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

Who knows what damage your dog inflicted on it! Sounds like it might have damaged the USB circuitry ot connector.

Dave

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

I have been trying to find a new board but it seems very hard in Europe at the moment and shipping from the US is very expensive (50$!)
The only model I was able to get now is the QT PY ESP32-C3, which I understand cannot do circuit python but only micro python...

Would it be very complicated to convert my code to micropython?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

I have no idea. But CircuitPython is a derivative/extension of Micropython so it shouldn't be too bad. Library support may be an issue.

Dave

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

Ok I had a look at the micropython setup on the ESP32-C3 page and it looks like I would need to do more studying and it would require me an additional effort which I am not motivated to do at the moment...
I was able to find the ESP32-S2 from Germany but I am also considering to go all the way and pay the 50$ shipping cost to get the S3 from Adafruit... I just need to make sure of something first: I prefer the S3 over the S2 because I am assuming that the Bluetooth (which only the S3 has) would allow my iPhone 6 to see and read the .txt file where the code logs my button feedback, whereas the WiFi (which also the S2 has) would not allow my phone to do the same thing... is this correct?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

I thin kBT is more likely to let you do that, yes. You might have to code it to do that, though. Not something I've had to do.

Have you looked at other European distributors? https://www.adafruit.com/distributors#Europe

Dave

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

Ok if I wanted to code the BT where would I find a guide? I looked on the S3 board page but couldn’t find anything on this subject.

Regarding the European distributors, I had already tried almost all the Italian ones with no luck... it seems nobody has it on stock and they don’t want to order it...
I’ve sent some more emails, let’s see what comes out!

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

I would start by looking at the bluetooth based project guides https://learn.adafruit.com/search?q=bluetooth. They might have things you could use.

Dave

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

Ok I started looking at the BT projects and reading the BT guides. One thing I noticed is that QT Py boards are not listed among those compatible with the Bluefruit Connect App (see screenshot).
Is there any way you can find out if I can really implement what I’d like to do, so I don’t risk spending a lot of money to ship the S3 board for nothing?
BTW today one of the Italian distributors got back to me and told me that Adafruit is not allowing any distributor to get that particular board (maybe because it is rather new?) and it can ONLY be purchased through your store...
Attachments
F9B87D55-B734-4EC8-B2F2-0D9E5880665D.png
F9B87D55-B734-4EC8-B2F2-0D9E5880665D.png (244.6 KiB) Viewed 121 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by dastels »

I'll ask. That list might be out of date. As for the distributor... it might be due to licensing or chip availability.

Dave

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: buzzing mindfulness bracelet code plus some new functions

Post by adafruit2 »

you can use nRF52840 boards, those have the best BLE support

User avatar
bozzaglia
 
Posts: 131
Joined: Mon Aug 01, 2022 6:14 am

Re: buzzing mindfulness bracelet code plus some new functions

Post by bozzaglia »

Thanks for the advise. I understand the recommended board is of the Feather type, so the size is probably a little too big for my project: feather is 51mm long while a QT PY plus BFF charger side-by-side measure around 36mm.
So I would lean towards sticking with the QT Py. Should I assume the QT Py S3 BT support is not sufficient to implement file reading from smartphone?

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”