fresh start with MDBT42Q , some specs before start toe code #4095
Replies: 1 comment
-
Posted at 2022-10-03 by David1234321 I have mange to work and took an working example from here: this is the code I have wrote:
when I connect using android phone "nRF Connect " I have 3 questions :
when I use the same code to connect to Arduino with the same chars - I can send data to it , so what am I missing ? Thanks , Posted at 2022-10-10 by @gfwilliams Hi - sorry for the delay, I was away last week...
Usually, yes. Although the opposite is possible.
Realistically around 10M
Not easily on the normal board, but we do sell some where this is possible: https://shop.espruino.com/mdbt42q/mdbt42q-breakout-ufl
Yes, that's fine.
If you're connected to the same computer you can sometimes use the IDE and python code at the same time (but not different computers). Otherwise yes, you'd have to use a serial cable.
Can you write to it using an app like NRF Connect on your phone? it would help to rule out any issue with the Pi. Hope that helps! Posted at 2022-10-20 by David1234321 first of all this is what I have now :
when I upload the code I see this error :
is this OK ? or does it mean I have a problem ? ***after I will see everything is working on with my phone , I will need your help with the python error of sending data Thanks , Posted at 2022-10-21 by @gfwilliams Great, this looks good!
There's nothing built in (often you may want to be able to send the same number twice). But it's easy enough for you to add code like
No, this is fine. It just means that Espruino can't change the advertised services when you're connected to it. The second you disconnect it'll change them and all will be fine Posted at 2022-10-23 by David1234321 Ok security question (before I continue with the python) and another question Thanks, Posted at 2022-10-23 by @fanoush https://www.espruino.com/BLE+Security for me it was enough to have this code to disconnect unknown devices and learn new ones when holding button as per "Disconnect when an unknown address is found (whitelisting)" chapter in that guide
Posted at 2022-10-23 by David1234321 OK - nice solution , also what will happened when someone will try to connect using the IDE and upload new code? Posted at 2022-10-23 by @fanoush
password does not close the connection, it protects only console not other services
you cannot connect via IDE when the device is not in the list, every connection from unknown devices is disconnected Posted at 2022-10-23 by David1234321 Ok I will try it today , some more "basic" questions
what am I missing? Thanks , Posted at 2022-10-26 by @gfwilliams I think the code you have there for the temperature is fine... 0x1D is hex for 29, which sounds like a reasonable number for temperature. I'm not entirely sure about the description. How are you reading it? On the whole the description isn't a very useful value as no software ever really looks at it though Posted at 2022-10-26 by David1234321 so 3.5 questions about it :
I thought maybe I can write something there - but if it's no used , so never mind.
does it tell that the data is bpm ? - if I'm correct : can I say I'm sending temperature using
then when I will read the data it will change it to C and I will see 29 ? 3.5 what will be if I'm sending heartrate using my own UUID ? Thanks , Posted at 2022-10-27 by @gfwilliams
No... it's just the way that nRF connect is showing you the number I think. In reality in whatever variable you're using it's just a number like any other
Yes, the description has no effect on the functioning of your code
That would be a variable that would contain the heart rate as a number. Like maybe 85 (eg 85 bpm).
You just have to look it up online - the Bluetooth SIG used to have a webpage showing them but they've made them a bit tricky to find now. You can just make your own UUIDs though for whatever you want to send, then it's up to you to interpret the result. Maybe check out https://www.espruino.com/About+Bluetooth+LE Posted at 2022-10-27 by David1234321 when I print to the OLED and you can see in the nRf he is showing decimal value and say it's temp I guess I will need to change the UUID also , no ? Thanks , About my code
Thank you again , Posted at 2022-10-28 by @gfwilliams
Yes... so in Try:
Posted at 2022-10-30 by David1234321 Ok, it's working - thank you! but now I see another problem ,
it turn off the led that connected to Relay_Pin when I remove the this line - the led stay on and one final "understanding" question: ***I mange to make my Python code work - and there I only used the CHAR UUID , didn't use \ took any attention for the Service UUID Posted at 2022-10-31 by @gfwilliams Reading the status of the pin turns it into an input. You can force it with Reading pin state isn't as easy as you'd think - if the pin was shorted then reading the value would always return 0 even though you might have set the output to 1 Posted at 2022-11-06 by David1234321 so I can't read the pin status and know if it's "1" \ "0"? Posted at 2022-11-07 by @gfwilliams Not reliably because you're reading the voltage on the pin, NOT what you set the pin to. Posted at 2022-11-22 by David1234321 Ok it seem that now everything is working for me (almost), Thank you very much for the help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-10-02 by David1234321
Hello,
I have a simple project I want to run and want to know if I can use the MDBT42Q
I want to see I understand the configuration correct:
so the PI is the client and the MDBT42Q will be the server , right ?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions