This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

PhyPhox and Micro:Bit
#1
I try using the PhyPhox App with the Micro:Bit. But i cannot reliable connect to the Micro:bit. Pairing and flashing with the microbit app is working.
First i had to change the given file, because my Android Smartphone connected it as BBC micro:bit [tetat] and after changing

        <bluetooth name="BBC micro:bit"> to <bluetooth name="BBC micro:bit [tetat]"

i managed one time succesfully to connect to the micro:bit and read the analog voltages. But now PhyPhx says, that the micro:bit doesnt have the characetristic E95D5899-251D-470A-A062-FA1922DFA9A8 (io_ad_config), see screenshot
I also failed to read out the magnetic bearing or other values. Is there any more documentation besides the wonderful wiki page https://phyphox.org/wiki/index.php/BBC:M.../_Calliope.

Thanks for your help


Attached Files Thumbnail(s)
   
Reply
#2
First of all, it is strange that you needed to change the name in the config file, because it is supposed to connect to anything that contains the set name in its name. So it should work even if the Micro:Bit adds the [abcde] part at the end. Could this just have been a coincidence as it only worked once anyway or are you sure that it is not working without the "[tetat]"?

The error message means that phyphox was able to connect to the Micro:Bit, but the Micro:Bit did not offer the LED service. Did you flash a sketch onto the Micro:Bit that launches the Bluetooth LED service?

If you are unsure about this, you can also try to connect to the Micro:Bit with an app called "nRF Connect" by Nordic Semiconductor (disclaimer: This is not our work and we have no connection to Nordic Semiconductor). With this you can connect to any BLE device and check the services offered by the device. If your Micro:Bit is set up correctly, you should see the "micro:bit LED Service". Interestingly, I just found that nRF Connect actually detects the micro:bit and has some demo macros to test the LED service.
Reply
#3
Dear Sebastian,

thanks for your help. I did a lot wrong. So i have to connnect with the Micro:Bit App, but it needn't to be active (see screenshot) Then the measurement works fine and there is no need to add the name of the specific Micro:Bit.
After the succes i tried to use your file and read the magnetic Bearing from the build in Server according to https://github.com/ukBaz/python-bluezero...icrobit.py.
But there also the Micro:Bit diddn't offer the characteristic

Code:
MAGNETO_BEARING = 'E95D9715-251D-470A-A062-FA1922DFA9A8'
With the nrfConnect App (see second screenshot) i could only discover the Characteristics of the PIN.

Code:
IO_PIN_SRV = 'E95D127B-251D-470A-A062-FA1922DFA9A8'
IO_PIN_DATA = 'E95D8D00-251D-470A-A062-FA1922DFA9A8'
IO_AD_CONFIG = 'E95D5899-251D-470A-A062-FA1922DFA9A8'
IO_PIN_CONFIG = 'E95DB9FE-251D-470A-A062-FA1922DFA9A8'
IO_PIN_PWM = 'E95DD822-251D-470A-A062-FA1922DFA9A8'
Is there any config file for build in sensor. It would be great to use the cheap Micro:Bit for measurements and display it via PhyPhox.

Best wishes Johannes Almer


Attached Files Thumbnail(s)
       
Reply
#4
Reading the magnetometer should be no problem. On the phyphox side we just need a configuration (QR code) that explains to phyphox where to get the data. I will see if I can create one soon.

However, you need to load a suitable program onto your micro bit to get the magnetometer characteristic, like this:
   

Then you should be able to find the characteristic in nRF Connect and only need the QR code for phyphox (which will follow soon or which you can try to create yourself with our editor if you know can follow the details on https://lancaster-university.github.io/m...r-service/).
Reply
#5
So, I have good news and bad news for you:

The good news is that I created a configuration to read the magnetometer from my micro:bit and added it to the Wiki page as an example. You can find the config there: https://phyphox.org/wiki/index.php/BBC:M.../_Calliope

The bad news is that - at least for my micro:bit - the readings are not usable for anything. The problem is that each axis is reported as a 16bit value that can range from -32,000 to +32,000 (approximately) and unfortunately, they overflow several times while rotating the device. So, for example the x axis value would rise to 32,000, jump to -32,000 while still rising and then falling after actually reaching a maximum. I am not sure if this is a specific problem with my device (I also triggered the calibration to try and fix this) and I could not find whether there is a factor with which actual units should be derived, but it is definitely not a phyphox issue as the behavior can be seen in the raw data in nRF Connect as well. So, hopefully it is only my device that does this...
Reply
#6
(02-15-2020, 11:37 PM)Sebastian Staacks Wrote: So, I have good news and bad news for you:

The good news is that I created a configuration to read the magnetometer from my micro:bit and added it to the Wiki page as an example. You can find the config there: https://phyphox.org/wiki/index.php/BBC:M.../_Calliope

The bad news is that - at least for my micro:bit - the readings are not usable for anything. The problem is that each axis is reported as a 16bit value that can range from -32,000 to +32,000 (approximately) and unfortunately, they overflow several times while rotating the device. So, for example the x axis value would rise to 32,000, jump to -32,000 while still rising and then falling after actually reaching a maximum. I am not sure if this is a specific problem with my device (I also triggered the calibration to try and fix this) and I could not find whether there is a factor with which actual units should be derived, but it is definitely not a phyphox issue as the behavior can be seen in the raw data in nRF Connect as well. So, hopefully it is only my device that does this...

Dear Sebastian,

i tested the config file and got the same results. Also Adafruit says, that the measurement isn't very convincing. Probably i try to measure the total strength. The values were partialy convincing, showing up to the orientation the same value for all three directions. Also for slow movements, it worked out sometimes.

I didi succeed with the Acceleration. The values were good, but according to Lancaster the value should be divided by 1000 and this didn't work. Is it due to the int16LittleEndian?
I attached the QR-Code from the Editor. Will try the others option during the upcoming week. Thanks for all your help.

Best wishes Johannes


Attached Files Thumbnail(s)
   
Reply
#7
Dear Sebastian,

Division was a bit a Problem, so i copied your Idea from the Pin0 Reading  to multiply instead.
Now it seems to work, but i will test the values in the upcoming week. The screenshot shows the Rotation of the Micro:Bit.

Thanks for your support.

Best wishes Johannes


Attached Files Thumbnail(s)
   

.phyphox   micro_bit Acceleration.phyphox (Size: 4.73 KB / Downloads: 1)
Reply
#8
It looks like in your version with division, you enabled "clear" at the input and at the output of the division. This way you delete the raw data after processing and replace the old results, so you only have few or no data points in your graph. The multiplication version only clears at "the the input" of the next element, which means that the raw data is kept all the time and that the entire dataset is regenerated all the time (which is fine for these few values). Also, you have left the buffer size at the default 1000 data points, so at some point old data will be replaced (the graph starts moving to the left) - just in case you wonder about this in longer measurements.

Did you find an explanation to the division by 1000? I saw this in their example code as well, but I did not find any documentation on it. At first I thought, the results might be in µT, but this did not really work out on my device and for a signed 16 bit integer, this would mean that the range would only be +/-32µT. This would mean that the range would be too small for Earth's magnetic field by design, which did not make sense to me, so I decided to use the raw values.
Reply


Forum Jump: