I would like to control an Arduino device with a Motorola phone.
I have a Lilypad (preferred), an Uno, and a Mega Arduino board and I have two Motorola phones (a Droid Bionic and a Droid Razr Maxx) both running Android 4.1.2. According to an App called "USB Host Diagnostics" neither phone has USB Host Mode capability.
A variety of sites suggest the problem is that the phone doesn't provide enough power to the Arduino. Their solution requires cutting up and reconnecting the wires inside the cables. Others say the creation of a special "dongle" solves the problem, as long as it is in the phone when it starts to boot up but is removed before it finishes. Others suggest that it requires rooting the phone, which I'm afraid is probably beyond my comfort level and skill set. And many of these postings are several years old.
Has anyone figured out an smarter/better way to either enable or work-around the host mode capability issue of these phones? Or would it just be easier to find a used Nexus or Galaxy phone?
Related
I have tested my code on Contiki OS Cooja Simulator, I now want to transfer it to esp8266 module but could not find a proper any guide on how to transfer code from ContikiOS?
It's not that simple - "transferring" the code to a microcontroller is the easy part! What you call "transfer" is more widely known as "programming", "flashing" or "uploading" in this area. Instruction how to do it with Contiki and Contiki-NG are in the tutorial here: https://github.com/contiki-ng/contiki-ng/wiki/Tutorial:-Hello,-World!#running-the-example-on-a-real-device
However, for an embedded OS such as Contiki to work correctly on a specific microcontroller, not only must the microcontroller specified in compilation settings (so that the compilers knows what code to generate), the OS itself must be adapted to that specific microcontroller and the specific board. Each microcontroller has its own way of providing functionality that the OS needs, for example, hardware timers and interrupts. OS needs to support the microcontroller, that is, provide an adaptation layer between the OS core code and the API exposed by the hardware. Different boards may use the same microcontroller, but differ in the pins used for I/O, LEDs, peripherals available, and so on. Each of the supported boards must have a small adaptation layer in the OS as well.
Unfortunately ESP microcontrollers have never been officially supported by the Contiki OS, so you will need to get another hardware to try it out!
I have a Microsoft Surface Book that I've dual booted Linux Mint on. I'm writing a program that needs to read in data from a serial port, but my serial ports don't seem to be working. The behavior is consistent across Mint and Windows (Testing done through Cygwin). It gets a bit of data the first 2-5 seconds that the device is plugged in (viewing the data through screen, same thing happens if I just use pyserial to print data incoming from serial port), then nothing.
What could be happening? I think I've isolated the problem to the serial ports - the Surface Book has 2 USB ports and the same thing happens on both of them, and I've tested the hardware that I'm plugging into it on 2 other computers (One Linux and one Mac OS), and it works fine on both of those.
Your MS Surface, seemingly, has a yellow triangle exclamation mark icon (over the adapter icon) without any driver to install/download. And properties in the device status box window say This device cannot start. (Code 10) or A device which does not exist was specified. Right?
If it's so you should wait for an update from MS. It's notorious problem.
I ended up getting the computer replaced on warranty for an unrelated issue months later, and what do you know, on the new computer the serial ports work fine. That indicates to me some sort of hardware problem, given that the issue persisted across OS's.
maybe this will help:
see Arduino examples for serial port communication - search google:
arduino serial c++
arduino serial c#
arduino serial c++ linux
the point is to open port properly you need to open a file, not a port. not with usual c - assembly write to port code.
another option you are using an unintentionally bought fake USB to serial cable with a Fake PL2303 chip
then you need to install the old version of the driver.
search in google:
Fake PL2303 + your os name:
install driver Fake PL2303 windows 10
another option is maybe it conserves energy and closes the port because it feels it is unused.
in windows> device manager,> properties of a device - usually USB root hub > power management - allow the computer to turn off this device to save power - uncheck it.
https://superuser.com/questions/408683/why-my-usb-mouse-gets-suspended-after-3-seconds-of-inactivity
https://blogs.msdn.microsoft.com/usbcoreblog/2013/11/08/help-after-installing-windows-8-1-my-usb-device-doesnt-charge-or-it-disconnects-and-reconnects-frequently/
also, you could look in windows events - to see what happens. usually, failures like this are registered in the events log.
an unlikely option is it consumes too much current, like a short circuit. and the device protection circuit shuts the chip off. also probably it does not have such circuit. one possibility is to try with an external powered hub.
the most probable of these is the power saving mechanism
I was experiencing the same problem - came across the solution on another site. The USB 3 ports on Surface Book aren't compatible with something or other to do with Com Port but running the device through a cheap USB hub solved my problem straight away and it was instantly recognised by the Arduino IDE
We've got two WinCE devices that need to talk to each other, they don't have WiFi or Bluetooth so I think a wired USB connection is our best chance. I've been reading up on using ActiveSync and serial over USB, but all the articles are geared towards talking between a WinCE device to a full Windows box, never between two WinCE devices.
If we can get ActiveSync working, that's fine, the other option is just to open COM ports on both sides and write our own communications protocol.
Given the project timelines, writing any sort of device driver isn't an option, this needs to be something that is built in to WinCE.
We are building WinCE for both devices, so I can make any modifications necessary at that level.
Is there a way to get these two guys talking to each other?
If you can't write your own driver then your fastest route is probably to get a USB to serial converter for both devices and then connect them via serial.
Obviously, you'll need to choose one that has support for Windows Mobile. I think FTDI based adapters should work.
Once that's working you just use the built-in serial API to read and write data.
**Overview of devices known so far:
Nexus 6,
Nexus 9,
Moto E 4G LTE,
LG G4,
Galaxy S6,
Samsung Galaxy S5 (model SM-G900M),
Nexus 5X,
Sony Xperia Z5 Compact,
Samsung Galaxy Tab S2 **
** Also see https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html **
One of the new features of the Android 5 release is support for Bluetooth Low Energy peripheral mode. While it is promoted to work independent of the used device, it seems to be chipset dependent (see the isMultiAdvertisementSupported() function in BluetoothAdapter.java).
It is working for the Nexus 5, but not for the Nexus 7 (called a bug in BLE peripheral support Android-L example, but it might never work because of its chipset?). Also https://code.google.com/p/android-developer-preview/issues/detail?id=589 does not give conclusive statements.
My concern is that, as many older devices are expected to get Android 5, only the newest tablets (and relatively new phones) will support BLE peripheral mode. This might be unclear to the end-user of apps relying on this new Android 5 feature.
For me it is very unclear which chipsets/devices, that will eventually get Android 5, will support the BLE peripheral mode. Anyone who can give me any insights on this? Which chipsets will support the BLE peripheral mode? More specifically, as many of our customers have a Nexus 7 (2013), will the Nexus 7 ever get supported?
Edit 19-2-2015:
Since December 2014 it is not supported anymore for the Nexus 5, only Nexus 6 and 9 seem to have support for BLE Peripheral Mode/ Advertising. Hope the number of devices supporting this will significantly increase in the near future.
More information and discussion here:
https://code.google.com/p/android-developer-preview/issues/detail?id=1570
Edit 6-3-2015: Added overview for quick reference
Edit 17-2-2016: Added some devices that I've checked myself but were not in any of the other lists
The Android 5.0.X will only allow you to use the new API for BLE. This new API comes with a new feature, which you mentioned in your question: The possibility of advertising, from your own Android device, using it in Peripheral mode. However, the disadvantaged of this new feature is that it is hardware dependent. For example, before you start any BLE you need to:
First: Check to see if the BLE is supported, which you can do by adding this line in your manifest: <uses-feature android:name="android.hardware.bluetooth_le" android:required:"true"/>
Second: You need to check if your chipset has support for it, using the following methods:
bluetoothAdapter.isMultipleAdvertisementSupported();
bluetoothAdapter.isOffloadedFilteringSupported();
bluetoothAdapter.isOffloadedScanBatchingSupported();
Also notice that for both of the above methods, the API documentation clearly states that:
"Return true if the multi advertisement is supported by the chipset"
"true if chipset supports on-chip filtering"
"true if chipset supports on-chip scan batching"
That being said, it brings us to the question:
"Which hardware devices are going to support this feature ?"
Well, the answer to that is a little bit more complicated since this is not a mandatory feature for the bluetooth hardware/protocol and it will probably vary from manufacture to manufacture. But for now, the only currently devices that officially are supporting the technology, without major issues, are the Nexus 6 and Nexus 9, since their hardware already comes with the support. The best that you can do it, is not rely solely on the technology for now and try to explore other possible solutions, if any.
Hope this is the right place to ask - assuming so as it is related to programming.
I am looking for some hardware (say a dongle) that would open up an API for my computer to a SIM card. Does that exist anywhere?
The idea would be that I can then use my existing SIM card on its existing network/contract and with a bit of code, send/receive calls and texts. I figured that if a phone can be programmed to do it why can't a computer? I just need the hardware.
Any suggestions if this kind of thing is possible? Even by maybe integrating a phone?
You can use AT commands with any modem or phone, whose driver exposes a modem port when you connect it to a computer. Plug in the phone or modem, and go to Windows Device Manager, and look under "Modems" and see what you've got. From "properties" of the Modem, you can see which COM port it is on.
AT commands are an older method of communicating with a modem. There is a standard set of commands for GSM/GPRS/3G/4G devices available from 3GPP.org, here. Manufacturers add their own proprietary commands for more obscure functions. Many but not all of these are in the public domain.
Some newer plug-in modems may appear as a network adapter (you can see this in Windows), due to their drivers. In this case, you can use the following interfaces:
on Vista: NDIS, proprietary interfaces
on Windows 7 and 8.x Desktop apps: Windows Mobile Broadband API
on Windows 8.x, in the Metro/app area: Windows.Networking and MobileBroadband APIs.
on Windows 10, UWP, there are UWP APIs here. But they do not give as much functionality as the Desktop APIs.
On Windows 8.1 and Windows 10, if the appropriate drives are present it is possible to use the new MBIM interface via the desktop Mobile Broadband DeviceServices API. Mobile Broadband Interface Model spec available here.
On Linux, use AT commands via the serial port.
I'm a bit puzzled by your requirement to make (voice?) calls via a phone connected to a computer. Do you mean Skype? In this case, of course, you wouldn't need any interface for making calls, you would just open an IP connection over a data session - which can be done via any of the above interfaces.
(added this comment as an answer, as there was more information)
I use this GSM device: http://www.mikroe.com/click/gsm2/ connected to a basic UART like: https://www.sparkfun.com/products/718?gclid=CIj1xOzbur4CFUVbfgodCpQASQ
Then use AT COMMANDS.
I also use a piece of software called QNavigator to inspect the modem/gsm: http://www.soselectronic.com/?str=1329