RedBear Blend

Ask, and ye shall receive.
josephshirk
Posts: 10
Joined: 17:08, 20 Jan 2015

RedBear Blend

Postby josephshirk » 17:23, 20 Jan 2015

Hi. First I want to compliment EVO Things for what you have done. I have a RedBear Blend and an Android 4.3 (Galaxy 5s). I have spent over a week investigating the various Arduinoid BLE platforms and it looks like your solution is far more elegant and simple than others. I am disappointed with the sample apps from Nordic (a closed-source pay SDK seems necessary). RedBear's sample apps have poor documentation, and the other solutions require browser based Arduino development (that only sometimes connect!), or target different BLE boards/shields and then leave you searching for the Android half of the solution. So thanks!

I know I have a lot to read, and my basic question is where do I start?

I tried the sample apps from workbench and my Android can't connect; I am certain it is a firewall issue and I have no idea how to solve that and I may not even have control over the router configuration. (This is just FYI). I don't even really care about this because I need my Android to talk to the Blend over BLE, and not depend on a connection over the LAN to the Workbench. In fact, my app MUST work while offline from the net.

I want a good example code that demonstrates this that I can edit. I'm going to make an educated guess on how it should work:
1. The javascript app can be developed in some preferred editor (or just the Workbench)?
2. The app can be saved on the Android and have a desktop shortcut to it. If I can't get the Android to connect over LAN, can I just side-load the .html file?
3. Is the Android app a server to, or client of, the Arduino BLE?
4. Develop the Arduino BLE side as usual using Arduino.app or is there a better choice?

That's it for now. Thanks again!

josephshirk
Posts: 10
Joined: 17:08, 20 Jan 2015

Re: RedBear Blend

Postby josephshirk » 16:05, 22 Jan 2015

BUMP

Is the post too broad?

I know I have a lot to read, and my basic question is where do I start?

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: RedBear Blend

Postby micke » 17:03, 22 Jan 2015

Hi Joseph,

Thanks for your post, you certainly highlight a number of important issues. Here are some hints and pointers that hopefully help answering your questions.

"I tried the sample apps from workbench and my Android can't connect"

The WiFi router not allowing connections is a problem indeed. Would it work for you to use a secondary router, or use a mobile phone with Internet sharing as a router? (I frequently use my mobile as a router with Evothings Studio, so I can work wherever I happen to be.) We are also looking at long-term solutions to this problem.

Another option that may seem a bit far fetched is to put the app files on a web server and run in Evothings Client by entering the URL to the app in the Connect address field in the client app. Then put a Reload button in the app that you press to reload it. Then you would edit/upload files to tbe webserver, and this work workaround the WiFi connectivity problems. Here is related info:

http://evothings.com/doc/build/share-apps.html

And here is a blog post that discusses this approach further:

http://evothings.com/hybrid-app-development-made-fast/

Of course you can always develop the app as you would with any Cordova app, without Evothings Studio (but the edit/run cycle takes longer time).

"In fact, my app MUST work while offline from the net"

You can build a native app with Cordova that can work fully offline. Evothings Client does not have offline support yet. Here is a Cordova starter guide:

http://evothings.com/cordova-starter-kit/

"I want a good example code that demonstrates this that I can edit"

For the ReadBear boards, there are two examples that comes with Evothings Studio:

http://evothings.com/doc/examples/redbe ... ntrol.html
http://evothings.com/doc/examples/redbe ... echat.html

Would any of these work for you as a starting point?

1. The javascript app can be developed in some preferred editor (or just the Workbench)?

You can use any editor with the Workbench. When you press save in the editor, the Workbench will detect the file update and tell connected devices to reload.

Here is an overview of the components of Evothings Studio:

http://evothings.com/doc/#Introduction

2. The app can be saved on the Android and have a desktop shortcut to it. If I can't get the Android to connect over LAN, can I just side-load the .html file?

Is might work to put a shortcut on the home screen with an evothings: URL, but this requires the app to be hosted online. Evothings Client will eventually have offline support (this may happen soon, but I have no date to promise).

3. Is the Android app a server to, or client of, the Arduino BLE?

The app has the "central" role and the Arduino BLE shield has the "peripheral" role, in BLE lingo.

4. Develop the Arduino BLE side as usual using Arduino.app or is there a better choice?

You develop Arduino code in the Arduino IDE.

Hope this help! Let me know how it goes.

Best regards, Mikael

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: RedBear Blend

Postby micke » 17:08, 22 Jan 2015

Hi again John, did not see your latest post until having posted my reply.

The main documentation page is one starter point, hope the links I posted can help you. We are also working on specific guide documents that will help to get started.

I do understand that there is quite a bit of information to digest!

Thanks!

Mikael

josephshirk
Posts: 10
Joined: 17:08, 20 Jan 2015

Re: RedBear Blend

Postby josephshirk » 18:30, 22 Jan 2015

micke wrote:"I want a good example code that demonstrates this that I can edit"

For the ReadBear boards, there are two examples that comes with Evothings Studio:

http://evothings.com/doc/examples/redbe ... ntrol.html
http://evothings.com/doc/examples/redbe ... echat.html

Would any of these work for you as a starting point?

Certainly, the control app has essentially the core functionality I'll need as a base to start from (I'm not going to have the pot, servo, or LEDs so i'll just dummy those to test a proof of concept.

micke wrote:
"In fact, my app MUST work while offline from the net"

You can build a native app with Cordova that can work fully offline. Evothings Client does not have offline support yet. Here is a Cordova starter guide:

http://evothings.com/cordova-starter-kit/


This I don't quite understand. I have seen your videos demonstrating an app monitoring several beacons. Are you saying such an app can't communicate over BLE without also having a live internet connection? Of course it makes sense that networking is needed to load or update the app, or to access any kind of web service. It would be a deal-breaker if the mobile app can't communicate with BLE devices out in the field where there is no cellular data service.

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: RedBear Blend

Postby micke » 00:03, 23 Jan 2015

Sorry I was not clear, here is what I mean:

* The app needs to be used offline (no network connection)
* Evothings Client does not support running apps offline, and can therefore not be used
* Therefore, the solution is to build an app with Cordova, packaged as a native app, that can be installed and then run without any network connection

Does this make sense? Is this a solution you can use (building an app with Cordova)?

Very best, Mikael

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: RedBear Blend

Postby Fredrik » 10:32, 23 Jan 2015

Evothings Client does not require an internet connection, just an IPv4 LAN (normally WiFi), to connect to an Evothings Workbench running on that LAN.

However, I just had a new idea: what if you entered a file:// URL into the Client's address box? Might it then load a page/app from the phone's file system? I'm'a test it.

Edit: Alas, that did not work. The Client inserted "http://" before the "file://" part, rendering the URL useless. We should probably fix that in the next version.

DonPancoe
Posts: 25
Joined: 06:53, 20 Nov 2014
Location: Philadelphia, PA, USA
Contact:

Re: RedBear Blend

Postby DonPancoe » 16:08, 23 Jan 2015

This thread might be of help.

Don

josephshirk
Posts: 10
Joined: 17:08, 20 Jan 2015

Re: RedBear Blend

Postby josephshirk » 06:55, 24 Jan 2015

the system I'm creating is for an e-bike. the android app communicates (is the UI) for a Blend (via BLE), which in turn communicates with a battery management system and cell monitor, the bike's sensors (throttle, RPM FET, etc) and the motor power controller. Therefore the app can't depend on an internet connection to load whenever it's time to ride.

I think I have to look at some hybrid projects that incorporate Android JavaScript frameworks (that can be deployed as standalone apps), Cordova, and BLE libraries.
These are some projects I'm looking into:

Amber
http://amber-lang.net
Amber smalltalk actually compiles into JavaScript, and can integrate seamlessly with other JS libraries. The code runs completely in the browser, and can be packaged for off-line apps [ https://github.com/amber-smalltalk/ambe ... on-web-use ].

Android-cordova app example:

https://github.com/amber-smalltalk/ambe ... ordova-app
a basic PhoneGap/Cordova adaptation of the Amber Hello World in Writing my First App, with a couple of additions to show Cordova accessing information about the mobile device.

Meteor
How can Meteor apps work offline?
http://stackoverflow.com/questions/1013 ... rk-offline

Meteor Cordova Phonegap integration
https://github.com/meteor/meteor/wiki/M ... ntegration

sample android app using cordova BLE in meteor:
https://github.com/yubozhao/meteor-cordova-ble

Derby
http://derbyjs.com
Much less mature, very small community, yet people are using it for production
6 things I'm loving about derbyjs
https://groups.google.com/forum/#!forum/derbyjs

derbygap - npm (phonegap)
https://www.npmjs.com/package/derbygap


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 10 guests