puck.js: advertisement not working !!! Need help #3020
Replies: 12 comments
-
|
Posted at 2019-07-17 by @gfwilliams Hi - is your firmware up to date? The code looks fine to me - I just ran it and I see the 0x181A service using nRF connect. It's possible that significantly older firmwares didn't have that code implemented and ignored the However it may also be because I believe Espruino tends to put advertised services in the scan response packet - so if you're just looking at ADV_IND you may not see the service? |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-18 by user94148 Hi |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-18 by user94148 Hi Then in the documentation they mention that the advertisement cannot be seen outside of a connection I suspect an issue somewhere or an error in the doc or a wrong usage ? Any idea and help ? Thanks a lot Vpl |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-18 by Robin Thr 2019.07.18 What are the results when connecting using the WebIDE as a monitoring tool?
or from a web page
Posting the entire code block would greatly assist here. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-19 by user94148 Hi Thanks very much for your answer My firmware is 2v04 I get ADV_IND as expected with period SCAN_REQ/SCAN_RESP. Nevertheless in the puck documentation it is written that we should get a similar behavior with the following code I've tested but DO NOT get any advertising. It is mentioned to be connected to the device. I've tried with the NRF Tool (android) to connect but no advertisement By the way (not a priority but questioning) I get a variable battery level with 5/10% change at each sample I've tried to change in the SetAdvertising with But same problem. Thanks for your support and help Regards |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-19 by Robin Fri 2019.07.19
Would you post the link please. There is plenty of documentation. ;-) Line #9 looks iffy, re: use of Uint16Array
Could you estimate please, an approximate date the Puck was first powered up, e.g. the plastic tab was removed? Then, roughly how many hours the device remains powered up, executing Javascript? e.g. compared to number of hours the battery remained removed Has any attempt been made to make use of sleep mode? > 'I'm developing labs for students and this puck.js is really a nice piece of Hw for training' Have you considered the MDBT42Q breakout board to be able to attach sensors, such as temperature, humidity, rain gage or even a GPS unit? |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-19 by user94148 Hi, Regarding this advertising behavior that does not work for me, I'm refering to this part of the documentation https://www.espruino.com/Reference#l_NRF_setServices Just creating a service doesn't mean that the service will be advertised. It will only be available after a device connects. To advertise, specify the UUIDs you wish to advertise in the advertise field of the second options argument. For example this will create and advertise a heart rate service: In my code (provided earlier in this post) I'm replicating exactly the same things but does not work What do I do wrongly ? Regards |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-19 by Robin Fri 2019.07.19 Thank you for the link, now we are all on the same page. I inquired about the battery. A possible area of concern. @gfwilliams pointed out in #2
Without all the code, it's difficult to determine a potential cause. As the firmware is up to date, What PC and OS are being used to view the error(s)? Please upload the error results from the WebIDE left-hand side. What other tutorials have been attempted? Those results? As a suggestion, try this tutorial. To make things easier, modify the Forum post example |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-19 by user94148 Hi For the Advertising issue I recap from the begining with the code such as we are on the same page: The puck.js documentation (https://www.espruino.com/Reference#l_NRF_setServices) states that a connection is required to get the ADV_IND. What is wrong ? is there an error in the doc and the "advertise" option does not work this way ? Thanks for your answer Regards |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-19 by Robin Fri 2019.07.19 Are the results similar, as in this working example that @user101905 just posted: Just reviewed the example at: > https://www.espruino.com/Reference#l_NRF_setServices See the fourth code block there. The issue seems to be in the argument of the advertise property. The format is a Json object, with the argument represented as a string. In Line #13 of the snippet shown in #10 above, indicates a string representation, for base clarification to humans, of the desired hex value and not the string for valid Json syntax that is that numerical hex value. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-22 by @gfwilliams I don't know if this is any help? http://www.espruino.com/About+Bluetooth+LE Basically Bluetooth LE is a bit confusing in that 'Services' can be used for Advertising OR as something that holds a characteristic when the device is connected.
The first 2 options only transmit data when you're not connected, and only the second option will use ADV_IND. The first uses scan response packets. Hope that's some help! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-22 by user94148 Hi Thanks very much for your support and help Regards |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-07-17 by user94148
Hi,
I've created the following service on my puck and asked for advertisement
I'm using the NRFsniffer to look at the trace. When I connect to the puck using the sniffer the only ADV_IND I get are only about the Device Name & Type. I never get the 0x181A service as expected.
In the doc it is mentioned that the master must connect to get these advertisement. But I don't get anything ?
Did I missed something ?
Thanks for your help and support
Vpl
Beta Was this translation helpful? Give feedback.
All reactions