Hello,
Ive been looking around for some time for a nice simple cross platform compiler to display data from an Arduino on various platforms. Connection would be via Bluetooth (or possibly WiFi) As this is not (I dont think) a core function, how can I connect my Arduino? An example would be great. I realise that this is still in Beta, and perhaps it cant currently be done, I guess that things like sensors, camera are platform specific (from posting on Vibrate) is there a plan to have a method of adding these devices.
Its great to see an old favourite still has life in it ( its still a LOT younger than me though!!!)
Thanks
Steve
Newbie question on what can I do in Android
Re: Newbie question on what can I do in Android
The easy way is to set up a WiFi socket connection via your router. There are a number of example programs supplied with BBCSDL that make connections via sockets, both to the wider internet (e.g. 'ceefax.bbc' and 'banner.bbc') and to other machines via a LAN ('client.bbc', 'server.bbc' and 'lanchat.bbc'). I don't know anything about the Arduino but I would expect that it can just as easily make socket connections so establishing a link that way ought to be straightforward. Documentation for BBC BASIC's 'socklib' library can be found here.
As you probably know, the extent to which I can contribute to such endeavours is increasingly limited. But I would be delighted for users to contribute code, which I could then distribute with BBCSDL in the form of a library or libraries.I guess that things like sensors, camera are platform specific (from posting on Vibrate) is there a plan to have a method of adding these devices.
One issue specific to Android and iOS is that apps must be given permission to access devices like the camera and some other peripherals; currently BBCSDL does not request that permission: you can access the accelerometer (and the internet) but that's all. If somebody wanted to experiment with accessing the camera one solution is to use the BBC2APK utility (available from the web site) to build a custom app that requests that permission.
-
- Posts: 2
- Joined: Sat 24 Nov 2018, 00:02
Re: Newbie question on what can I do in Android
Wow,
amazingly quick response, thank you, looks like someone was up later than me!!. I really would prefer BT. The arduno is only an 8 bit chip, and although it can be done I dont think its as easy as BT to Android which effectively becomes a serial port. I can do it in B4A, which is good, but really requires more knowledge of Java/VB than I wanted, or needed. BT is also available in RFO basic, but that has no cross compiler capability. Most Android - Arduino wifi connections seem to go through a cloud server, which means you have to have internet access, or by connecting device directly to Android wifi which means you cant connect to Internet. For my applications a serial port by USB would be great, but then thanks to the stupidity of using the USB to charge as well as data transfer many tablets/phones can only do one or the other.
I wil explore socklib further.
Thanks
Steve
amazingly quick response, thank you, looks like someone was up later than me!!. I really would prefer BT. The arduno is only an 8 bit chip, and although it can be done I dont think its as easy as BT to Android which effectively becomes a serial port. I can do it in B4A, which is good, but really requires more knowledge of Java/VB than I wanted, or needed. BT is also available in RFO basic, but that has no cross compiler capability. Most Android - Arduino wifi connections seem to go through a cloud server, which means you have to have internet access, or by connecting device directly to Android wifi which means you cant connect to Internet. For my applications a serial port by USB would be great, but then thanks to the stupidity of using the USB to charge as well as data transfer many tablets/phones can only do one or the other.
I wil explore socklib further.
Thanks
Steve
Re: Newbie question on what can I do in Android
By all means use Bluetooth, but it will be more work. I suggested a socket connection because that is supported 'out of the box' in BBC BASIC and there is a supplied library 'socklib.bbc' to make it easy. Bluetooth is not currently supported by a library, but if you would like to be the guinea-pig and help develop (or at least test) the necessary code I would be very happy for you to do so! For a start it will be necessary to grant BBC BASIC this permission:
Code: Select all
<uses-permission android:name="android.permission.BLUETOOTH" />
It's not obvious to me why that should be the case, but as I said I'm not an Arduino expert. If both those options are available I would have expected that a connection via your main WiFi router should also work, it's 'just' another socket connection after all.Arduino wifi connections seem to go through a cloud server, which means you have to have internet access, or by connecting device directly to Android wifi which means you cant connect to Internet.