Developing an Android App For a Bluetooth Device
#1
I have found a bluetooth device that I would like to try and develop an app for.

This would be a new adventure for me. 

There is already a phone app for the device but it does not meet my needs.

Other than having the data from the manufacturer, how would you go about developing an app that will communicate to the device?

Is there an app that would monitor the data traffic between the devices?

I have emailed the device manufacturer in hopes they will share the information, so an app can be developed for their device.

Device in question:
http://www.wirelessmultimeter.com/default.asp
  Reply
#2
(12-03-2016, 02:17 PM)Traveler Wrote: I have found a bluetooth device that I would like to try and develop an app for.

This would be a new adventure for me. 

...

Device in question:
http://www.wirelessmultimeter.com/default.asp

You will need to contact the company.

... I reviewed most of the site before posting this response. The device is not open;  that means that its codes ( and its blue-tooth interface ) are proprietary. To write your own app will require reverse engineering the device and probing its bt interface;  this is of course possible, but way more work than the device's price tag $129 makes relevant. 

I don't know how their app could not meet your needs;  its a very simple set of values and what it measures is all there is. 

You would be better off making your own device ( ADC  use an mcp3002 ) and read the device with SPI. Keep your own stats and design your own interface.  ( this approach will be WAY cheaper too )

If you're bent on writing your own app for this device you're going to have to get the specs on the device; if the company will not provide those you are left with probing and reverse engineering.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#3
In order to find out the data protocol used by the app, that you will need to contact the company (and almost certainly if you release the app, as they would probably sue for breech of intellectual property even if it were free) unless it is a simple comma-delineated list, or an otherwise simple to decode protocol. However, you don't need the contact the company in order to do the other major part of the question....

(12-03-2016, 02:17 PM)Traveler Wrote: Is there an app that would monitor the data traffic between the devices?

Just like with wifi, it is possible to 'sniff' or monitor bluetooth activity/traffic. The stuff in android doesn't seem to be as fully featured as a typical wifi suite like Wireshark, but it may do the job. As of Android 4.4, there is the ability to log all Bluetooth traffic in the developer options... so that might be worth looking at to see what the data protocol looks like. These two links will give you some info to get started...

How the Bluetooth sniffing on Android works
Sniffing/logging your own Android Bluetooth traffic

From the looks of it, this device is intended to be able to monitor an up to 20v supply, and also measure a 30A load... so it certainly isn't impossible to make your own unit, basing it on something like the AC714 hall effect current sensor, which will give you bi-directional current measurements, so you can measure charge and discharge current. Then probably just a voltage divider for the voltage sense, which is where the MCP3002 would give you more accurate readings than something like the ADC on an Arduino would. The power (watts) is just a calculation based on the voltage and current. If you want to be able to use a shunt like with the Wireless Multimeter to measure higher currents, you'll also want to use a MCP3002 there to measure the really low fluctuations in voltage... which get harder to track the broader your current range gets. 

However, I suppose the another question that should be asked is why use the pine64 in this situation... is it going to be a car computer, and you wanted to add an app so it could monitor this unit?
  Reply
#4
Thanks for the information and links.

Yes this is for a car computer and adding the app to the bundle.

The internal 30 amp sensor is of no real use as of now, no need to measure low current useage. Using a shunt would be the option but not the best choice. Best option would be a change in hardware. Trying to measure low voltage signal changes in the mv range in an already high voltage noise area is a feat best left for those that like to beat their head on a wall. It requires tight filtering first follow by an op amp circuit to broaden the range of measurement. If you amplify this signal without the filtering you will decrease signal to noise ratio. Also using a shunt, in an environment where you are trying to conserve energy. is a big waste of energy. Energy given off as heat from the resistance.

Best option and one I have contacted the manufacturer about is to modify the analog section of the shunt section. I have located some 12 volt dc powered hall effect current sensors that the wiring can simple pass thru. These are available in ranges +- 100 amps to +- 600 amps. Analog output is 2.5 volts +- 2.0 volts with 2.5 volts= 0 amps. At this voltage level the filter does not have to be as critical and no amplification is required to raise the level or expand the range.

Hopefully with these changes it would lower the component count, add accuracy, and ease user installation. I don't think there would be much change in cost. The device may lower in cost, the price of the hall effect sensor is more expensive than a shunt. So total cost would be a wash.

For now it is just wait and see what their reply is. I will play with sniffing on some BT devices I have here now to prepare myself for later. I have done serial data in the past when the data protocol was unknown.


P.S. Don't sniff someone else's ear buds. Ear wax is not a pleasant smell.
  Reply
#5
(12-03-2016, 08:41 PM)Traveler Wrote: I have located some 12 volt dc powered hall effect current sensors that the wiring can simple pass thru. These are available in ranges +- 100 amps to +- 600 amps. Analog output is 2.5 volts +- 2.0 volts with 2.5 volts= 0 amps.

P.S. Don't sniff someone else's ear buds. Ear wax is not a pleasant smell.

lol... hm... that's the benefit of bluetooth... you can sniff from a distance?? :-P

Nice... do you have a part number or manufacturer name for those parts... I'm wondering if they're simply higher current model of the Allegro ones I've used in past? These ones perhaps?
  Reply
#6
http://www.inpowerdirect.com/dccurrentse...ensors.php
  Reply
#7
i'd wager based on a look at the website that this company is not very high-tech in any of their solutions so as pfeerick suggests sniff the connection to see in what form they are sending the data. my guess would be it's very basic. if that's the case all you need to do is write an app. it seems to me that 130 bucks is too much for a bluetooth battery monitor. take a look at amazon. i would think hobby shops sell them under 50 bucks for drones and rc copters. in any event, interesting topic, keep us posted.
  Reply
#8
Can tell you this gleaned from reading data sheets and manual this is a little more than just the basic. I wager there is a pic processor and some form of non volatile memory. It handles all the sampling and data storage like a daq system. It is also doing all the math and remaining battery capacity based on known formulas. The app is just downloading that data and displaying in a fancy display. There are parameters that are set with the app writing to the battery monitor. These are battery capacity and shut size if used.This device should be called an intelligent battery state of charge monitor.

Most Bluetooth battery monitors either just monitor voltage or if they do measure current they measure it at 100 amps or less. Yes it is easy and cheap when you are at that level with the chip devices listed earlier. That is the way the RC battery gauges are made. Nothing new there.

Since this for automotive applications I have to measure in the 500-600 amp range for measuring during cranking and being able to ACCURATELY measure battery state of charge. No sense in limiting current measurement range at 100 amps. Everytime your cranked it you pegged out the range for those few seconds with more than 100 amps drawn. You can't determine wattage used without an accurate amperage measurement.
  Reply
#9
(12-04-2016, 04:35 PM)Traveler Wrote: Most Bluetooth battery monitors either just monitor voltage or if they do measure current they measure it at 100 amps or less. Yes it is easy and cheap when you are at that level with the chip devices listed earlier. That is the way the RC battery gauges are made. Nothing new there.

Indeed... most of the RC ones I use are just dumb display units... and whilst the one I use the most claims to be able to measure from 0-60v (4.5-60v without an external battery) and 0 - 180A (it was 0-100A when I got mine)... I have to think if you used it for more than 10 seconds at those sorts of loads the plastic would start dripping off!!! 

Thanks for that link... they look much nicer and should be just a bit more accurate than the usual dodgy eBay options!!! :-D

Yes, if you can track voltage and current well, and have also set the battery capacity, then it becomes a very nice battery state-of-charge system. Hm... there must be some temperature sensing in there somewhere to help with the accuracy...
  Reply
#10
Yes I believe it is on the bottom side of the device. Proper mounting would be on the side of battery not the top. Case appears to be 5 sided and the board potted in place with temp device exposed.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Android 6.0 Tablet and TV (release candidate, maintained) ayufan 227 73,014 04-06-2020, 10:46 AM
Last Post: omkarn
  New Device Trees for A64 jonsmirl 4 1,419 02-18-2020, 07:03 AM
Last Post: j23
  Android Things OS dqvsra 2 1,158 12-03-2019, 09:52 AM
Last Post: hangglider
  Is there another link for Android images? Maalth 3 392 10-10-2019, 07:57 AM
Last Post: tophneal
Question Android SDK Oreo NGC6691 2 509 07-15-2019, 08:29 PM
Last Post: dazza5000
  Putting Android 9 RockPro64 source into easier to manage repositories dazza5000 0 267 07-15-2019, 08:29 PM
Last Post: dazza5000
  Android 5.1.1 TV (old-stable, no longer maintained) ayufan 194 58,547 03-12-2019, 04:53 PM
Last Post: neosapien
  Issues with SD Card and Running Android Twistedx 0 362 02-26-2019, 11:58 AM
Last Post: Twistedx
  Android 7.1 (PINE A64(+)) pineadmin 59 29,719 02-10-2019, 07:44 PM
Last Post: mmmarcus
  +LTS/SOPINE Android SDK support and Customization biplab777 1 445 01-07-2019, 01:21 AM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)