Arduino-> Android bluetooth visualization

Hello there, i hope this is the right forum(if a phone counts as computer) for things like that. in recent days I developed an android app called BlueGraph mainly for msp430, but also tested with arduino, which simply reads from blueooth via serial port profile and plots realtime graphs for the incoming data.

The data has to be in a format like: (integer)(seperator)(integer)...(\r\n) 123,142,1241 //would produce 3 graphs with real time data

There is also a logging functionality which simply writes the incoming data to a log file.

The app is free and ad_free.

I uploaded a short demo video to youtube.

If you have any suggestions or feature request, please write here or in the play store comments :)

Regards, Lukas

123,142,1241 //would produce 3 graphs with real time data

I'm curious how you produce a "real time" graph without getting the time corresponding to when the values were produced.

PaulS: I'm curious how you produce a "real time" graph without getting the time corresponding to when the values were produced.

The graph is updated whenever Arduino sends a value. That's real time. You only need the clock value when it isn't.

Apparently not compatible with 4.2.2 phone

Yeah, it's real time without a clock(every value is t+1) :) Actually I sticked to the Android suggestions for bt apps (4.4+) due to bt 4.0 - eventually I wanted to add bt low energy support which is bt 4.4 only, but thanks for your feedback - I'll look if it's spoosible to use backports to support lower android versions

Regards, Lukas

sakulstra: Yeah, it's real time without a clock(every value is t+1) :)

That's fine. Real time is "now", and you don't need a clock to tell you when that is. You are probably aware that Bluetoth Graphics Terminal works the same way, and there is no need to be spooked by Paul. He is is just being an ignorant smartarse with little knowledge of practical application. In the unlikely event that somebody might need it, you may find you can include it in the logged data anyway, but I submit that it is quite superfluous and wouldn't bother.

Actually I sticked to the Android suggestions for bt apps (4.4+) due to bt 4.0 - eventually I wanted to add bt low energy support which is bt 4.4 only, but thanks for your feedback - I'll look if it's spoosible to use backports to support lower android versions

I guess you can expect Android to say that but I'm not sure it is good advice. There are a lot of older Androids out there. My 4.2.2 phone is only a month or so old and probably typical. My KitKat tablet is a year old but currently suffering comms problems. I will try your app as soon as I find next door's WiFi password.

As it happens, I thought my phone had BLE anyway. Further, I'm surprised this is an issue. I understood that, if a BLE finds it is talking to BT2, it simply reverts to that protocol - no user intervention required.

I think being confined to integer is a deal-breaker - more important than the clock! BT graphics started out like that but I got onto the guy and it was promptly upgraded. Needless to say, I have no idea how hard it was to do that.

Good luck with this interesting exercise.

I’m currently writing at my phone - sry for the markup

Nick_Pyner:
As it happens, I thought my phone had BLE anyway. Further, I’m surprised this is an issue. I understood that, if a BLE finds it is talking to BT2, it simply reverts to that protocol - no user intervention required.

I think being confined to integer is a deal-breaker - more important than the clock! BT graphics started out like that but I got onto the guy and it was promptly upgraded. Needless to say, I have no idea how hard it was to do that.

Good luck with this interesting exercise.

The first point isn’t quiet right I think :confused: there is a sort of fallback from 4.0 to 3.x but devices like the blend micro are only able to communicate via bt low energy which has no fallback to prior bt versions.

Float support is a good idea I think :slight_smile: haven’t thought about it yet as I only use it for volt referenced Eps sensors.

Thanks for ur feedback, I’ll write here as soon as I wrote a patch :slight_smile:

So there is a new version online Versioncode: 1.3 - play store needs some time till you can actually download the new version(perhaps you have to wait a few hours) :)

I wasn't quiet able to test 4.x support because i have no device with other android versions than 4.4 and bleutooth emulating isn't possible yet. While compiling for 4.0(api14) i got no errors and as i'm not using ble yet, i simply decreased the minimum version. So it should be possible to use it on android 4.2 now :)

Float numbers are now supported and there was a bug when manually setting the min and max for y axis(max couln't be lower than 0) which is fixed in this version.

Also the backstack is used now, which allows pressing "back" to navigate trough the menus(there is still a little bug in the navigation highlighting i couldn't resolve yet).

Are u talking about this app? https://play.google.com/store/apps/details?id=com.emrctn.BluetoothGraphics&hl=de I tried the app(free version) but couldn't really use it because it forces me to use "E" as start tag and i dont want to rewrite my applications, also i thought 5$ is too much for a simple bt graph ;) ... allowing a start tag could be a idea for the next update

Regards and thanks for your feedback, Lukas

Yes. For me, it is the killer app and the principal reason for getting a smartphone. I have only ever bought three apps but this is so good, I’m happy to pay the money. I get serious professional value out of it. It’s not a game, and my parallel system cost about $350.

The app isn’t perfect either. I find it easier to use Bluetooth Terminal to download the daily files - you know, the ones with the timestamp.

I must have read your first post on the phone and used your link. I can’t trawl it in the playstore. I have tried going back via your link, but it still says it is incompatible.

Nick_Pyner: I must have read your first post on the phone and used your link. I can't trawl it in the playstore. I have tried going back via your link, but it still says it is incompatible.

sakulstra: perhaps you have to wait a few hours

Probably it isn't yet upgraded in your region (as soon as the bottom of the play store link says 1.3 it should be compatible) - this procedure can take up to 24h :/ - got an update in Europe this minute

Nick_Pyner: The app isn't perfect either. I find it easier to use Bluetooth Terminal to download the daily files - you know, the ones with the timestamp.

I don't know Bluetooth Terminal but i thinks it's pretty similar to BlueTerm(which i use for this purpose). I think allowing automatic file naming via a timestamp as filename is a pretty good idea! - I already added the feature but want to wait with the push till i fixed some bugs ;) will probably make it tomorrow

Thanks for your feedback, Regards, Lukas

OK. This inability to trawl BlueGraph baffles me. All I get is radio stations in Kentucky. I have bookmarked your website so I can find it.

Bluetooth Terminal and Blueterm are more or less the same. I had grief with the latter and stuck with the former, but that was probably just me being a learner.

Automatic filename-by-date is vital in this casual Android world. I think the same goes for Arduino datalogging too and I was alluding to the Arduino files. That is where the clock comes in. I send DDMMs to Arduino and can get several daily files from there, all stored in one file on Android labelled with today's date.

I still have not got my 4.4.2 tablet back on air, and still no joy with the phone @ 0130 GMT

Good luck - I wouldn't go near the water you are swimming in, I'm too old and it's full of crocodiles, but this is looking good.

Thats really awkward - even the play store link says 4.0 + now(at least for me) https://play.google.com/store/apps/details?id=sakulstra.androidbluetooth

I just added the last two features(v1.4): 1. timestamp as name (can be configured via settings) - timestamp only - filename + timestamp 2. it's allowed to use start tags now (have to be configured via settings)

I think the next steps i should do are some performance tweaks (with 100hz and 2graphs the view gets laggy for a window size of 500 at my p780 :/), stability improvements and redo the texts. If you have other suggestions I'm open to nearly everything ;) Perhaps the ability to send messages to the connected device would be useful...

Regards, Lukas

OK, I imagine I'm a typical user, not particularly demanding. This is a summary of what I do.

I just want casual occasional readings standing near the instruments. I use a phone.

BT Graphics is used to display three graphs, the numbers are floats and updated once per second. The app will display the number string but I don't see much point in that. I wouldn't mind four or even five graphs but if that were available I would probably use my 10" tablet. As it is, BTGraphics will accept a raft of extra data and you can configure which three you use on the fly, but I have never bothered.

An advantage of the above operation is that the graph runs at 1Hz, which is Arduino's loop speed.

Meanwhile Arduino is sending the serious data to SD on a continuous basis, once every ten seconds. A new date-named file is made at midnight.

These files are casually downloaded with Bluetooth Terminal. The message is just MMDD, Arduino fills in the YYYY. BT Terminal makes a date-stamped logfile, which may contain several several days of download. Arduino repeats the full name of the file before sending the data, so BTTerminal picks that up too.

These files are transferred to PC by WiFi at liesure, and the data stays on the SD.

What I would like is to do the above with one programme - and five graphs.

Hay Nick,
i’m not pretty sure if i got everything right(my english isn’t the best)

Nick_Pyner:
BT Graphics is used to display three graphs, the numbers are floats and updated once per second. The app will display the number string but I don’t see much point in that. I wouldn’t mind four or even five graphs but if that were available I would probably use my 10" tablet. As it is, BTGraphics will accept a raft of extra data and you can configure which three you use on the fly, but I have never bothered.

An advantage of the above operation is that the graph runs at 1Hz, which is Arduino’s loop speed.

This should actually be possible with BlueGraph - i don’t see where 1Hz is an adventage, but BlueGraph should already be able to display values independent of their rate.

These files are casually downloaded with Bluetooth Terminal. The message is just MMDD, Arduino fills in the YYYY. BT Terminal makes a date-stamped logfile, which may contain several several days of download. Arduino repeats the full name of the file before sending the data, so BTTerminal picks that up too.

You send sth. like 0101 via bt to the arduino and it answers with the log file for the specified day? Did i get this right?

Except for the sending to arduino BlueGraph should already be able to archive this. In the terminal view you can simply press the “start log” button and it should log anything incoming to a timestamped file(you have to activate this in terminal settings).

So this are the features for the next release(hopefully in two days)

Features i plan for the next release

  • ability to send messages
  • multiple graphs(this moment you can only have one graph, but with infinite charts)
  • infinite/clinching graph(not only sliding window ring buffer with fixed size)[\li]

Regards,
Lukas

sakulstra: don't see where 1Hz is an adventage, but BlueGraph should already be able to display values independent of their rate.

There is no advantage. It's just the rate at which Arduino updates the Android graph, i.e. the loop cycle.

You send sth. like 0101 via bt to the arduino and it answers with the log file for the specified day? Did i get this right?

Correct. I send 0504 and Arduino sends back 20150504.csv i.e. I then have yesterday's complete Arduino file in today's Android file. I could then send 0503 and have two Arduino files in one Android file. They are not used in Android, merely stored for later transfer, and the relevant sections may then be cut and pasted into Excel.

Except for the sending to arduino BlueGraph should already be able to archive this. In the terminal view you can simply press the "start log" button and it should log anything incoming to a timestamped file(you have to activate this in terminal settings).

I guess this may be good for people with short, one-shot events but I would never use this, and I think the philosophy is wrong. It is making Android an integral part of the project and requires me to be on the job with the phone for the whole event, but the event runs for ever. That is a job for Arduino, not humans with a phone in their hand. The vital word for Android is "casual" and Arduino handles all the serious stuff.

I have used a tablet on a charger long term with BT Graphics, but that was much more of an intellectual exercise than a good idea, and there are better ways to get Arduino to do the job. It may also have wrecked the tablet!

Your English is fine - certainly much better than my Dutch or whatever...

Just letting you know that I have my tablet back on air and have downloaded BlueGraph OK. What's more, I found it by trawling Google Store rather than having to use your link. I can also find it OK on the phone now but it still says that it is incompatible. I will reprogramme my stuff soon.

Hi

I'm not quite certain about the commands. I am looking at modifying my programme. It sends three floats. Here are some snippets

Setup()

  stringOne = ",";
  stringTwo = "\\";

loop()

dtostrf(InTemp,4, 2, strIn);
dtostrf(OutTemp,4, 2, strOut);
dtostrf(diff,4, 2, strdiff);

stringThree = strIn + stringOne + strOut + stringOne + strdiff + stringTwo;

  Serial.print(stringThree);

Does that look OK? I'm not used to those print commands.

Nick_Pyner: Does that look OK? I'm not used to those print commands.

Seems kind of awkward to me - especially the "\" as endline.

You could do:

stringThree = strIn + stringOne + strOut + stringOne + strdiff;
Serial.println(stringThree);

or even

Serial.print(strIn);
Serial.print(stringOne);
...
Serial.println(strdiff);

instead.

Regards, Lukas

sakulstra: Seems kind of awkward to me - especially the "\" as endline.

That's what I didn't understand in your post

The data has to be in a format like: (integer)(seperator)(integer)...(\r\n) 123,142,1241 //would produce 3 graphs with real time data

There is no semicolon in the last line. With BT graphics, I just use

Serial.println(stringThree);

as you suggest.

I will shut my gear down soon and try this. My phone still does not want to knbow about it!

Hay sorry for the bad description text - i’ll fix it :confused:
“//” is just the comment sign.
BlueGraph should be able to read lines like
134,2343,234,123
or
12.4,12.4,234.2,232.1
where “,” is the delimiter specified in the settings.

If you want to use prefixed lines u can set the prefix for example to “E” in settings and BlueGraph will accept lines like:
E134,2343,234,123
or
E12.4,12.4,234.2,232.1

Regards,
Lukas

Ps: thx for trying :wink: - i still didn’t get a phone with android < 4.4 to test your problems :frowning:

Edit: tested with 4.1.1 and it works :slight_smile: - perhaps to have to refresh the app store or sth.?