Getting gps data from blackberry (pearl) directly from usb interface - blackberry

Has anyone researched how to access the gps chipset on a blackberry over usb so that it is unnecessary to transmit this data over the cell carrier's data network?
Is it possible to access the GPS chipset, store information in a buffer, and open an interface connection (over the usb charging port), for access? Not sure if J2ME allows for this...

Checkout the "UsbDemo" project and the "GPSDemo" that are included in the blackberry JDE.
the GPSDemo listens to the GPS and stores the location information into a buffer that gets sent over the network.
The USB Demo shows how to interact with a desktop client over USB.
You should be able to pull on the network code from the GPS Demo and put in the the code to talk over USB.

Related

Is there a way to communicate with smartphone remotely via a sensor without using internet?

I want to detect and send/recieve data from a smartphone in some vicinity without using internet.
I've always thought it would be fun to do this with audio. Most modern ways of modulating a signal (like OFDM) will sound like a white noise hiss over audio, and you should be able to get a few KB/s in a normal room environment if the phones are close to each other.
It also has the benefit that the user can always tell when it's transmitting.
Multiple methods are possible.
You could use a private (isolated) local area network that is not connected to the internet. Either ethernet cabled or over WiFi.
Airdrop might not require an internet connection (a WAN connected access point).
Bluetooth BLE communication doesn't require an internet connection. You could use an ESP32 or Raspberry Pi to read sensor data and have a mobile device connect over BLE to the ESP32 or Pi (or another mobile device).
You could use audio. Play FSK tones or Morse Code on one device and receive and decode the audio modulations on another device. (I've tried both of these methods successfully.) Or you could use a speech synthesizer on one device and a voice transcription app on another.
You could use light. Flash the flashlight (or LED) on one device, and receive and decode the light pulse sequences using the video camera another device. (There may be apps in the App store that can do this.) Or display a bar code or QR code on one device and use the camera on another to decode the data in the bar code or QR code.
You could use MIDI. Bluetooth MIDI over BLE from device to device. Or with MIDI cables, using a bunch of Lightning to USB and USB to Midi adapters.
You might be able to use vibrations from the Taptic engine on one device, and detect the vibration sequences using the motion sensor API on another device.
With many Android devices, you can connect a USB to serial port dongle, and use a long RS232 serial cable between devices.
With an iPhone, you could use a Lightning to Ethernet adapter, plus a fiber optic media converter, and send signals over several kilometers of (private) fiber optic cabling. etc.
You might want to use the IR sensor on your phone by using an IR sensor library. (Search it on a search engine). If the does not have that, you can use a QR code generator library (Search it on a search engine) to transfer your data.
You could use a raspberry pi (for example) to take readings from your sensor and store them. Make it run a webserver and create its own wifi network (not connected to the www) where you can access a webpage that displays the readings. Or you can set it up so that the Pi logs into the wifi hotspot from your phone whenever available and then uploads the data or sends it in an email or whatever.
You can use an internet module, for example the FONA 800 or 808 by Adafruit to let your Pi talk with the internet, via a SIM card from hologram.io for example. The Pi can talk to the FONA in Python. But to be honest that doens't really answer your question with the proximity thing - but if I were you I would drop that and do the following:
Read the data from the sensor and save it to a csv file on the Pi
Once every hour (or whatever), connect to the internet via FONA/hologram.io SIM
Insert the data from the previous hour to a remote mysql database
Use PHP or something to display the data from the database nicely and access via your phone
That way, you can have as many sensors as you want and access all from your phone. As I said the proximity thing is not relevant for me, it's easier imho to go through cellular (+ I wouldnt know how to do it over lets say bluetooth)

Internet access between WiFi-IoT in Access Point mode with mobile phone connected

I did a lot of brain-storming about this, and couldn't reach a solution.
I am posting this as i can get some ideas.
I have developed a WiFi-IoT based device with sensor, which shows up in AP mode. A mobile phone connects to this AP and then the device starts sending sensor data to the mobile phone. A mobile application plots and displays this data.
Now, i want to send this data from mobile to internet. Connecting my mobile to another AP with internet is not an option, as i don't want to break the continuous data transmission.
Using internet of data provider is one option, but that brings constraint of have mobile data.
What other options do i have to send my data from mobile to internet ??
Edit:-
I worked on the suggestions, and came to this point:-
1) WiFi-IoT device (in station mode) and mobile phone connect to same Internet-enabled WiFi access point. WiFi-IoT device has the IP address of the mobile phone for current network, and sends data to a TCP port (eg. 9801) of this IP address. The application in mobile phone reads the data from the port no. 9801 and stores it and hosts it on the internet.
This works fine.
2)WiFi-IoT device comes up in Access Point mode, and the mobile phone connects to this Access Point. Now there is one-to-one connection between WiFi-IoT device and mobile phone.
My question is, in the second scenario, without breaking this one-to-one connection, is there way to host data to internet:-
1) without using mobile internet provided by mobile data service provider ?
2) without using a second mobile phone ?
I may be wrong, but i am just asking this to make be sure whether my requirement can be achieved or not !!
I don't think you can connect to two APs at the same time.
Maybe use Bluetooth as device to phone link?
Or have the device connect directly to internet after some config done in AP mode and then send a copy of the data to your phone app (either via WAN or locally to the private IP your phone gets from the Internet gateway AP)?
--Edit--
Let me explain about the second one:
What I mean is basically have your IoT device directly connect to Internet and send data to a server (your phone has also to be connected to Internet). Then make the server send a data copy back to your phone. It's two step process: 1) while the IoT device is in AP mode, use your phone to login and configure which Internet-connected AP it should be connected to. This serves as UI for your IoT device. 2) start sending data.
Or a bit ugly, just let the IoT device talk to your phone in the same WiFi network via private IP.
I brought up this way because you mentioned anyway your device has to send data to Internet(I assume it's a server) and have phone talk to a known location server is more portable and scalable once you have more than one IoT device.
--Further Edit--
I don't think there is a way to do what you described. At least from my experience:
1) on the link layer, the wireless NIC has to be able to connect to two APs at the same time. This is not a feature currently available.
2) on the network layer, there has to be two IP address attached to the same NIC, which I don't think is available in current OS for wireless NICs. Though there is a way to do this for Ethernet card, I.e. via Aliasing.

Data Transfer between iOS and PC over WiFi

I Need to create an iOS application and a PC application, the two need to be able to exchange data over Wi-Fi (either direct or via a wifi router).
The iOS app will act as a remote control for some of the features of the PC app, for instance, if a video is playing on the pc application then the iOS app will have buttons to control playback on the PC such as play, pause, stop etc, when one of these buttons is pressed then I need to send some bytes to the pc over wifi.
My questions are:
how should I go about sending data - Wifi direct or via wifi network that both devices are connected to?
can anyone help with example code to connect or send data to a specific device over wifi for either methods?
to be clear, I don't need help with creating the applications themselves - only the wireless transfer of data between the devices using the Wi-Fi radio whether it be direct or via a router.
The main question: is it possible to initiate a connection/send bytes under iOS over wi-fi to a pc on the same network or via wifi direct?
Help with the method to do this or example code would be helpful.

How to detect whether Bis-B is through carrier or Wi-Fi programatically?

How do we programatically detect whether the BIS data traffic is routed through the carrier network or Wi-Fi. Looking at the BB logo dots, we can see that it will be near Wi-Fi indicator if data is routed through Wi-Fi, and near the carrier signal indicator if the data is routed through the carrier data network.
Is there a way to detect that programatically?
You can use the API to determine if a particular service is capable of carrying BIS-B or BES traffic. Since BIS-B and BES are automatically routed through the least expensive means, if Wi-Fi is capable of carrying it BIS-B will go by Wi-Fi.
The KB article in Mister Smiths's comment specifies BIS-B access is available with a qualifying data plan (AKA a BlackBerry data plan, BlackBerry bolt on, etc
"To connect to the BlackBerry Data Services over Wi-Fi for PIN
messaging and BlackBerry Internet Service connectivity, the BlackBerry
smartphone requires a BlackBerry data plan from the wireless service
provider..."
). Given a qualifying data plan BlackBerry Internet Service (BIS) is available under all conditions specified in the chart. If the Wi-Fi connection supports a connection to the BlackBerry router at the ROC then BIS will travel via that connection unless a better option is available. One such better option is also known as "wireless bypass". When a BlackBerry in connected (by USB or BlueTooth) to a PC with internet access and Desktop Manager installed, the BlackBerry will use the PC internet connection.
The KB article also mentions BES. It is often helpful to think of BIS/BIS-B as a subset of BES capability hosted at a RIM Operations Center. Both BES and BIS/BIS-B make use of the BlackBerry router capabilities. The BlackBerry will automatically seek out the apparent least cost method of connecting with the BlackBerry Router either BES or BIS/BIS-B. In order of preference that is: wireless bypass; Wi-Fi; wireless carrier.
Try disabling Wi-Fi:
Radio.deactivateWAFs(RadioInfo.WAF_WLAN);
Maybe you could also detect if Wi-Fi is active calling RadioInfo.getActiveWAFs, but how would you know if it is your app the one using the connection?
To detect whether BIS is going through Wi-Fi, use
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) {
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B, RadioInfo.WAF_WLAN, false))
{
//BIS-B going through wifi
}
else
{
//BIS-B going through carrier
}
}

iPad accessory communication through UART

We manufacture a new accessory for iPad/iPhone which should transfer commands to the iPad. We like to use UART (through a certain Apple-protocol called Lingo). My research shows that I can only use USB (30PIN Connector) and custom protocols.
Question:
Is there any way to use UART to connect to the iPad accessory from APP side?
If the protocol is implemented in UART, we should be able to move it to USB, if it's not available to my App via USB.
My main guess is that the UART commands & access are protocols reserved to the iPhone OS and not available to Apps. Certain UART commands also include settings for volumes and Audio re-routing etc, so I guess that's secured.
Without jailbreak, you will not be able to access UART on iPad/iPod/iPhone as a normal developer. If you need access to the serial port or USB, you need to join Apple's MFi ("Made for iPhone") program and you will get full access to all relevant information. Unfortunately, you'll have to convince Apple that you're doing serious business and have a high volume manufacturing facility at hand (see also this thread).

Resources