A relatively large Bluetooth network - networking

Is it possible and will it be efficient to build a large network of mobile devices over Bluetooth?
For example all Bluetooth enabled devices in a large building so that any device can exchange a small object with any other device in the network through some devices that are in between?

Bluetooth is not meant for that. Interference will be a problem if the devices use a high enough TX power level so that all of them can communicate with each other. You can come with a smart application that can forward messages and restrict range of communication to a smaller area, but you'd be reinventing the wheel.
Look into Zigbee or XBee radios instead, this is exactly the scenario they were designed for.

Related

Is it possible to set several advertisements for the same Bluetooth LE device?

To test bluetooth scalability, I want the same device (a Raspberry Pi or a laptop) to emit several BLE advertisements. So far, I have tried using bleno (NodeJS), hcitool and CoreBluetooth for OSX, but I can not setup more than one.
Is this a hardware/system/bluetooth limitation? Has somebody managed to do this?
Different bluetooth devices have different maximum advertising rates. These typically range from 10Hz to 40Hz. Some bluetooth devices have the ability to spoof their MAC address so different advertisements appear to come from different physical devices. This is often important for scalability testing, because some receivers keep track of unique devices by MAC address.
As #Emil says in his answer, it is possible to "interleave" advertisements such that you change the advertisement (and ideally the MAC address) every few hundred milliseconds so it appears by receiving devices that there are multiple advertisers around. I have done this with both Raspberry Pi and iOS transmitters, but in neither case could I alter the MAC address.
It is important to understand, though, that the actual number of packets received when you do this does not change. So while you may be testing scalability of unique advertisements detected, you will not be doing the same thing as testing with multiple physical advertisers.
That's not possible by the Bluetooth specification. However you can start off with one data then set a timer in your app that stops advertising. Then you start off again with the next data. And so on.

How can I detect if there is data activity on a USB flash drive with my own circuit?

I am currently working on a project for my university course. I am design a device which will be an intermediate interface between the computer and a USB flash drive, i.e. data go from computer->my device->USB drive.
One of the functions I want on this device is to be able to detect if there is any data activity going on, and send this information to the microcontroller. I don't need to know anything about the data itself, just whether there is data being transferred.
I've done some research online about how USB works, but I can't seem to find a good way of doing this. I have spoken to a tutor at uni. Apparently this is "very easy" to do, but I don't really know how. Can anyone suggest some ideas? Thanks very much.
In this case the simplest way is to use additional soft which can log USB protocol as well as a microcontroller, like USBlyzer (http://www.usblyzer.com/) or USB data capture (http://www.eltima.com/products/usb-capture/)
You need to insert your flash drive to device which is plugged to USB port in your computer. Then run USB data analyzer software and find the USB port. That's all! After that you can monitor and analyze all data between microcontroller and the app. Moreover, you can save and export captured data
Your tutor not quite right.
USB bus always have activity, even if no data transferred.
Carefully read USB specification (http://www.usb.org/developers/docs/), especially 'Protocol layer' section. Some basics you may read in 'USB in a nutshell' article.
Explore bus with oscilloscope.
Also you may use software analyzers like http://desowin.org/usbpcap/ or http://freeusbanalyzer.com/ to explore data on bus.
I think, will be enough to capture all packets on bus with external microcontroller, measure their duration and sort waste SOF packets and valuable data packets.
Sure, your microcontroller must be fast enough, to keep pace of USB 2.0 bus. Detection of activity of low-speed devices, like keyboard, will be much simplier, and may be done even with arduino.
You are trying to make a protocol analyzer like catc http://teledynelecroy.com/protocolanalyzer/protocolstandard.aspx?standardid=4
These is a device which is like man in middle for any network.
You would need your device to act as USB host(master) and USB device(slave) at same time. Also while copying data from one port to another you need to make a data copy for analysis. USB devices have critical timing requirements and operate at high data rate. So you might need good amount of processing power in your device. Also this makes such analyzers expensive.
If there is no requirement for analyzing USB protocol, you can have device that will analyze slower buses like uart,spi I2c etc.You can check hobby manufacturers like sparkfun for such tracing devices.
Best luck with your endeavor

Arduino wireless communication

So what is the easiest way to get started? There are so many options available it's hard to decide, from a beginner's standpoint, which is the best.
What is the best option for simple wireless communication? That is, communication from a controller to move a robot, or from an arduino to relay information back to a computer for processing.
Drawing from your experiences, what's the 'best' option in your opinion?
Bluetooth would be the most flexible, however I believe xbee to be the easiest. Software wise xbee is exactly the same as serial an even allows for wireless reprogramming and the higher end ones have some serious range.
Bluetooth can be easy if you have a Bluetooth device you're trying to talk to (e.g. Mac-book or Smartphone). The problem is that Bluetooth radios for the the Arduino are still (in 2013) expensive. A Bluetooth radio usually costs more than an Arduino! Low Power Bluetooth may be an option as well. Essentially, Bluetooth is a simple serial transfer of data so you have to create your own protocol on both sides.
Bluetooth Low Energy BLEis an emerging technology and is available on some new devices (recent iPads, macbooks etc: Supoorted Devices ), this may or may not meet your requirements.

wide area broadcast over wifi

I want to find a solution to broadcast voice over WiFi for the people in a march. Since Android and IPhone is the most popular devices among the people in the march, it would be great if i can find a solution for audio broadcast over wifi with limited budget.
I know that people in occupy movement use different app on their cell, but it is not suitable in a march in my city. As the authority in my country may temporarily shutdown the data over mobile network to disable the app.
If i can develop an app to gather the broadcast message (SSID) from a powerful wifi AP with a long-length directional antenna, I should able to deliver message among the people in the march. Is it a possible solution?
Also, is it possible to modify the AP to allow any device to join the AP without further acknowledgment and broadcast message to all devices in that network?
Any idea or opinion is welcome.
Many Thanks.
This will be difficult, especially with a large number of users. Since you only need to send audio in one direction, that will at least be a bit easier.
First, you're going to want to put that AP in the middle of the crowd with an omnidirectional antenna. Perhaps, in a backpack or something. Each phone on that network needs to "hear" when other phones are transmitting, or it will be a mess. Even though your application is one-way, 802.11 isn't.
Now, when you write your application, use UDP packets sent to the broadcast address. No need for TCP packets, as they will clog up your network anyway.
Use a simple voice codec, such as AMR. The codecs available vary from platform to platform. See this document for a list on Android: http://developer.android.com/guide/appendix/media-formats.html
Honestly, the easiest solution would be to go buy a small FM transmitter, since many phones have receivers in them anyway.

microcontroller based sensor project: ZIGBEE vs GSM

My application will be having many microcontrollers with sensors monitoring a large area. The application requires all these microcontrollers to send the data to the master microcontroller. From the master microcontroller the data must go to desktop PC via serial connection and to a mobile application. Which one (Zigbee/GSM) will be suitable?
This completely depends on what you mean by "Wide Area." A few hundred square meters? A few hundred square kilometers? Zigbee is more cost effective and simpler to implement if you're within range. You could even mesh your nodes together to extend the collective reach of your network. Otherwise, well, you have no choice but to use something like GSM.
RF Line-of-sight range on readily available XBee Modules can be up to 2 miles. Higher power models can be had with 40 mile LOS range.
If you are within range, I would recommend ZigBee as that saves you the cost from having a sim-card in each device.
Buy zigbee modules that have SDK and HW ability for mesh networking. That will give you ability to talk to far nodes via routing nodes. Unfortunately zigbee can not do adhoc mesh networking so you need to know in advance what your routers will be, or to program your nodes routing your self. Another 802.15.4 module (by Synapse) can solve all this since it supports ad hoc mesh networking for you via SNAP protocol. It is not zigbee compatible, but Synapse modules are already adopted by big players like Garmin so this should not bother you. They also run much longer on batteries then zigbee modules. They can also give onboard analog and digital IO accessible without need for additional MCU (although you can connect it and give control to it if you wish). There is also USB stick that will enable your PC to talk to these modules.

Resources