Hosting a web service on a microcontroller - web-services

I saw some devices online which had wifi and exposed some information which was collected by an samrt device (iOS in this case). Do you know of any microcontrollers which would be useful to expose some data read from a sensor (by WiFi)?
Example: Expose termometer web service - if someone request for the current temperature make the reading (or pass the cached reading) and send it to the requester.
Thx for your help in advance.

The Raspberry Pi device appears to be available for cheap, has an Ethernet connection, and even has a beta Stack Exchange community. You may be able to do something cheaper -- no GPU, for example -- but this might be a reasonable starting point.

I have recently played with a http://ruggedcircuits.com/html/yellowjacket.html to do what you want to do.

I think Yoctopuce have some hardware that might allow you to do exactly that:
http://www.yoctopuce.com/EN/article/an-autonomous-solar-weather-station
This is a solar weather station, based on a temperature sensor on a WiFi module. The WiFi module reads the temperature from the temperature sensor and automatically post it on the internet. It's fully plug and play, no programming needed.

Related

What ways do I have to stream openCV output to my own remote C++ gui?

So I have on one hand an embedded device with a camera running openCV and on the other hand a C++ (Qt) GUI. I would like to connect both i.e.:
"stream" all the output image frames/video from openCV to my remote C++ gui
send commands from my C++ gui to the embedded device
How can I do this, what possibilities do I have? I was thinking about sockets, but I don't know whether that is the easiest solution to stream the image frames from openCV to my Qt gui.
Thank you
You should give us more details about what you're trying to achieve.
You say "stream [...] to my remote C++ GUI": do you mean sending the data over a cabled connection? over a LAN network? over the Internet?
Depending on the answer this changes your system's architecture quite a bit. Especially in case you want to stream the data over the Internet. If your use case implies a LAN network, you can easily setup a peer-to-peer connection between the embedded device and the C++ app to send data. However, it's much more complicated if you want to send data over the Internet, because it is difficult to create a peer-to-peer connection if you don't have static IPs (which I'm assuming you do not have). You will need a server (which can be written with Qt as well) to work as a relay for sending data from the device to your C++ app.
Do you need actual video streaming (at 25fps), or is a low refresh rate (1-0.5fps) sufficient ?
(I'm making the assumption you want to send data over a network)
Because if a low image rate is sufficient, using WebSockets to send images on a regular basis might just do the trick.
Otherwise, you'll need to setup a UDP connection with a video buffer.
Hope this helps!
D

Dronekit android tower telemetry update frequency

I've just started looking into building something using dronekit. Before I dive headfirst into this (and I fully realize this might be a difficult question to answer): What kind of telemetry update frequency can I expect from the 3DR services underlying an android app (say that I'm using a PixHawk controller with the 3DR telemetry downlink plugged into my Android's USB port). I need something as instantaneous as possible, no slower than 1Hz and optimally down to 5-10Hz (talking about both telemetry update events from the drone, and the ability to send commands to the drone). Is it possible at all to get that kind of speed using this stack?
Sending commands to the drone is not throttled at the moment, so it can be as fast as your logic and hardware allow.
The receiving update frequency is currently locked at 2Hz. We're looking into making it customizable in a future release.
For more information, feel free to ping the dev team directly on the gitter channel.

controlling ethernet speeds in lan c++ windows

I am wondering if it is possible to limit/control ethernet upload and download speeds on specific transport layers (tcp/udp) using c++? I am trying to make a simple to use program that can control the speeds of any device that the ethernet is connected to. For example: Computer B is connected to computer A via Internet Connection Sharing, I use my program to limit computer B's download or upload speed to 120kbs (or any number i choose), with this I would also like to choose udp or tcp.
Basically, I want to create my own program similar to net limiter and other such software, but I also want to add my own features which many of which lack for my needs. These other features are easy enough, but I have no idea how to go about the actual limting process.
The way forward in the general case you ask about would be to create a virtual network adapter and all the monitored route traffic through it. Once that was done, then you can monitor streams between hosts or on specific ports.
Not an easy job... A starting point would be the Windows device driver kit.
If you were prepared to limit just one app, and could modify it, the task would be much simpler... wget and curl for example both offer limiting.
HTH, Ruth

Linux C++: Accessing network statistics

I am developing a network statistic program in C++ for Linux.
I would like to access some statistical information about the current network connection.
E.g.:
packet loss,
bytes transferred (upload and download),
current network load (upload and download),
Any idea how to access this kind of information?
so, i have been trying to accomplish my objective using de /proc, we can find alot of information, but there is some missing information i need. I am thinking in developing a simple C++ promiscuous application, using LibPcap, that captures the network traffic i need and starts taking the metrics i want.
The Con is that i think this is going to be CPU intensive, at least more then needed ...
Any thoughts about this ?
All this information are spread into /proc/net files (updated by kernel). The most important file is /proc/net/netstat. Into to /proc/net/dev there are device statistics. You could open and parse.
A lot of information is available from the "files" in /proc/net.
/proc/net/netstat would be a good place to start.
AFAIK, it is possible to retrieve statistics information programmatically through the rtnetlink interface. See e.g. this mail for examples
You can access Network statistics trough /sys/class/net/NAME_OF_DEVICE/statistics.

Creating C++ client app for some abstract windows server - how to manage TCP connection to server speed?

So we have some server with some address port and ip. we are developing that server so we can implement on it what ever we need for help. What are standard/best practices for data transfer speed management between C++ windows client app and server (C++)?
My main point is in how to get how much data can be uploaded/downloaded from/to client via his low speed network to my relatively super fast server. (I need it for set up of his live stream Audio/Video bit rate)
My try on explaining number 3.
We do not care how fast is our server. It is always faster than needed. We care about client tyring to stream out to our server his media. he streams encoded (via ffmpeg) live video data to our server. But he has say ADSL with 500kb/s of outgoing traffic. Also he uses some ICQ or what so ever so he has less than 500 kb/s per second. And he wants to stream live video! So we need to set up our ffmpeg to encode video with respect to the bit rate user can provide. We develop server side and client side. We need a way of finding out how much user can upload per second currently (so value can change dynamically over time)
Check this CodeProject Article
it's dot-net but you can try figure out the technique from there.
I found what I wanted. "thrulay, network capacity tester" A C++ code library for Available bandwidth tracking in real time on clients. And there is "Spruce" and it is also oss. It is made using some of linux code but I use Boost library so it will be easy to rewrite.
Offtop: I want to report that there is some group of people on SO down voting on all questions on this topic - I do not know why they are so angry but they deffenetly exist.