Rust STM32: webUSB publishing sensors - rust

For a hobby project using the stm32f1xx-hal, I'm wanting to periodically read a sensor and then push the values such that I can graph them realtime in a webUSB app.
I have found an example in webusb_blinky by mvirkkunen which demonstrates the connectivity portion, but it's not clear to me how I would adapt it to publish sensor values. Should I be overriding control_in?
Any suggestions/help would be appreciated. Thanks!

You could define a control transfer that requested the device respond with the current sensor values but the more natural USB mechanism for publishing sensor updates is with an IN endpoint.
The usbd-serial module is the best example I can find of creating and using endpoints with this framework. A serial port consists of both an IN and OUT endpoint for bidirectional streaming of data. For your application you would only need the IN endpoint since the device only generates data.

Related

Interacting with BLE Cycle Trainer

My current is on Flutter using Dart and working with Bluetooth low energy devices. I have the basics up using this library and am able to do the following
1. Search for devices and list
2. Connect to device
3. Retrieve services and read characteristic values
4. Subscribe to changes on characteristics.
In order to interact with device correctly I need to read and write from the correct services/characteristics to read data and set things like resistance on the flywheel
I have used the below link and have started mapping out the services, however although the reading can be worked out. The writing to characteristics is a bit out of my reach.
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.cycling_power.xml
The question is.
Does any have experience working BLE cycle trainers and could provide
some insight into how to read and manage services and characteristics
appropriately?

Sensor Tag CC2650 - reading movement sensor

Is there any way to read data continuously upon request without using notifications? Thank you for your help.
If you want an app capable of working with all the sensors from CC2541DK, CC2650STK, ThunderBoard React and Sense (e.g. accelerometer., magnetometer, gyroscope etc.), you can download it from: BLE SensorTags (blessTags) – the software is able of giving new uses (movement & magnetic security, accelerometer mouse, PC remote control and wireless presenters) to all these IoT SensorTags. For more info: Bluetooth low energy SensorTag.
Yes, it is possible. You have notifying and reading mechanism of data transfer - in CC2650 almost all characteristics support both mechanism of data transfer. But other characteristics can only be accessed based only one method of data reading. One such example is the reading of the buttons states on the CC2650STK and CC2541DK that can only be read by means of the notification mechanism. But, notifications is preferred if you need a higher data transfer rate between the SensorTag and your application.

Direct bluetooth access to sensors on Microsoft Band

I am looking for a fitness band which provides direct real-time sensor data over Bluetooth to a mobile (Android) app. I want to write a health app that tracks the heart rate continuously. Most of the bands I found, does not provide direct access and the sensor data needs to be synchronized over the web.
While searching I came across the “Microsoft Band”. Their website (http://developer.microsoftband.com/) says it provides data directly over Bluetooth. But I also found out that for an third party Android app to access the sensor data one has to install “Microsoft Health” app beforehand. Hence I am in doubt whether the data for the Microsoft Band also gets synchronized over the web through the Microsoft Health app or not.
Can someone please clarify my doubt, i.e. whether the sensor data can be access directly at real-time or not. I just want to be sure before buying the product.
On Android, in order to stream sensor data from the Band via the Band SDK, you must install the Microsoft Health application. However, the aggregate data collected by the Microsoft Health application and sync'd with the Cloud is completely independent of any data streamed in realtime by a third party application.

Bluetooth 4.0 LE -- Conceptual -- Sending data form master to peripheral AND from peripheral to master

In Bluetooth, specifically 4.0 LE (if this changes anything), what is the way to send data both ways, from master to slave and from slave to master?
What kind of protocol is it better to design? Can you please provide an example of an application level protocol that is typically used in this scenario?
In this case, should the peripheral run two services, one used for sending data to the device and another to receive data from the device? (The "device" is the peripheral/slave).
The most forward way of doing this would be to define a custom service which defines the data types and fields and access you need as characteristics, and implement this on both the peripheral and central. If you are looking for a symmetric system, you can implement the same service on both sides. If there is differences in how the two devices access/send data, you can implement two different services, suiting your needs. Either way, you will need both the slave and master peripherals to support both GATT server and GATT client.
Depending on what you want to do, you could either push data using notifications (unconfirmed, you may miss updates on the receiving side) or indications (confirmed, the receiving side will have to acknowledge the push), or you could pull the data using read commands. You could also combine these in various ways, and you could implement access to different data in different ways in your service(s).
I recommend taking a look at the different Bluetooth Low Energy vendors' dev kits and APIs, as well as the different phone/tablet APIs and examples, depending on which platform you aim to develop on/ are familiar with.

How to send data to website from GPS device using gprs?

I had planned to do mini project. With GPS modem using GPRS(sim card with internet connection) and i need to send the data from GPS modem to a website. Is it possible? If so how it can be done? What are the languages needed? And also tell me about the best GPS device?
GPS devices communicate using a standard protocol called the NMEA protocol.
Assuming you are using .NET you can check out the Positioning code in the DotSpatial open source project: http://dotspatial.codeplex.com/
They've got classes to decode the NMEA strings and can probably do much of what you are describing out of the box.
As for the best GPS device, if you need standard resolutions, any GPS device will do. They can be had for 10's of dollars. We often use the USGlobalSat model BU-353, although this is USB so it may not work in your application.
For what you want u must do 2 things
1. Create a TCP Listener which will wait for info using TCP in same port and put into database
2. Create a web or windows application for you read from database.
i have done something like this in my recent project.
Regards.

Resources