New RPi Zero W - with Wifi and Bluetooth

Anything not related to STM32
User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: New RPi Zero W - with Wifi and Bluetooth

Post by RogerClark » Tue May 16, 2017 12:58 am

mrburnette wrote: Roger,
I'm sure you know that the Raspberry line of boards are quasi-Open Source; that is, the Broadcom low-level firmware is not (as far as I can determine) open: https://github.com/raspberrypi/firmware
firmware
This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
......


Depending upon the spirit of the Open Source target you are shooting for, this simply could be a brick wall
....
Thanks Ray

When I said "Open Source", I should have phrased that differently.

I was interested in modifying the Android OS, and having the source code available was the important thing, but whether the whole thing was completely Open Source

With Android, as far as I can tell, no one produces hardware, including phones and tablets, which is completely open right down to the hardware drivers level.
(Actually, I guess it may be possible to build Android for the X86 architecture which may be totally open source, but I think it would be extremely difficult to do)

Since I last posted, I have managed to build LineageOS (Android 7.1) for my 3 year old Moto G2 phone, from the sources downloaded from github.
But, part of the build process, requires that some proprietary binaries are extracted from the phone, hence its not fully open source.

It took my Core i5 machine, nearly 5 hours to build the sources, but it worked in the end!

ag123
Posts: 798
Joined: Thu Jul 21, 2016 4:24 pm

Re: New RPi Zero W - with Wifi and Bluetooth

Post by ag123 » Tue May 16, 2017 6:39 am

accordingly it is quite possible to run android on beagle bone black or raspberry pi 3
http://bbbandroid.sourceforge.net/
https://www.raspberrypi.org/magpi/android-raspberry-pi/

beaglebone bone black is somewhat slower in performance than raspberry pi 3 but is considered more 'open'. beagle bone black is pretty much open sources for much of TI's 3358 processor and the debian distributions. the other good thing about beagle bone black is that more gpio's pins are broken out and that it has an on chip 'PRU' (real time unit) processor that could take up tasks delegated from the cpu. hence beagle bone black i'd guess would be more targetted towards control apps.

while on raspberry pi 3, the processor is quite well understood but the specs isn't actually released and the high speed DSI video, and possibly the HDMI interface and MIPI camera interfaces which is very popular are pretty much closed sourced and few specs if at all is known about them. but the raspberry pi 3 with quad core A53 processors and possibly hardware video acceleration is considerably more performant than beaglebone black

on intel Edison , some people are trying to run android on intel Edison
https://communities.intel.com/message/258700#258700
accordingly it is quite possible to run android on intel compute stick
http://www.linuxium.com.au/how-tos/andr ... erlingcity

then there are also Allwinner boards with android ported
https://www.olimex.com/Products/OLinuXi ... e-hardware

beyond 'android' i'm quite used to the de-facto linux (debian) installations on beaglebone black and raspberry pi, i'd think the 'ordinary' linux offers more flexibility in terms of various app scenarios, e.g. it is pretty possible to run openoffice with a keyboard on it if one is determined to. and linux is more suited to the work in serial terminal scenario, while android offers much more apps designed for the 'touch screen' variety

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: New RPi Zero W - with Wifi and Bluetooth

Post by RogerClark » Tue May 16, 2017 11:01 am

@ag123

Thanks...

I just thought I would try Android on the RPI 3 as I had one sitting around doing nothing, but either its not fast enough or the current proprietary binaries are not optimised enough for it to work that well as an Android machine

Better off just to load Raspberian or one one of the many other linux distro's

ag123
Posts: 798
Joined: Thu Jul 21, 2016 4:24 pm

Re: New RPi Zero W - with Wifi and Bluetooth

Post by ag123 » Tue May 16, 2017 12:56 pm

i had actually 'gone the other route', i.e. from android to arduino, i've developed some apps with eclipse / java with google android sdk prior, those things works well especially on the 'higher end' phones. the thing about android is that it is 'pretty much a phone' or for that matter a self contained 'consumer appliance'. it has its own accelerometers, (even including gyroscopes), its own gps, camera, some of them have temperature sensors and even barometers and compass. those things are well and good.

but the moment you wanted to interface a 'non standard' peripheral, you are pretty much 'stuck' with the 'completeness' of the device. it is all it is no add-ons, hence arduino start to come into the picture :lol:

apart from the ever popular wifi and bluetooth, my thoughts are that a most straight forward way to connect android and stm32 duino is none other than usb otg on the android and usb-serial on stm32,i'd think it is possible to dfu a sketch that way as well :D
https://github.com/UmbrelaSmart/android ... programmer

Ollie
Posts: 197
Joined: Thu Feb 25, 2016 7:27 pm

Re: New RPi Zero W - with Wifi and Bluetooth

Post by Ollie » Tue May 16, 2017 2:58 pm

That is the way to go - connect STM32duino products to Android phone using USB. I am a coach for FIRST Tech Challenge team and those small 18"x18"x18" competition robots have been using Android phone as the robot controller starting in 2015. The vendor of the connected I/O modules have changed over the years. First it was Hitechnic, then Modern Robotics Inc, and this year RevRobotics. The SDK for that was developed by Qualcomm.

The phones are very affordable - under $40. Last week I got new Moto G4 Play phones for $50 from Amazon. Beaglebone and RPI cannot beat that price.

Lessons learned: the USB cable between phone and I/O modules has been very fragile. With MRI, there was an USB bridge to connect all modules to the phone. That caused a lot of headache for the teams. With RevRobotics, there is USB connection only to one module and all other connections from there are with UART.

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: New RPi Zero W - with Wifi and Bluetooth

Post by RogerClark » Tue May 16, 2017 10:14 pm

I came to a similar conclusion about android interfacing several years ago.
I bought some cheap 7 inch tablets for $15 each,a few years ago, hoping to use them as displays and input devices for my projects.

But At the time, USB OTG via serial was the only thing I could use to interface to the Arduino, but finding a USB serial driver for the tablet was difficult.
And unfortunately, the tablets did not have any community support on XDA, so loading a replacement ROM was not an option

Things are a bit different now.

If you are using the Moto G4 Play, you may be able to unlock the bootloader ( but possibly not if bought as an Amazon version).
(My wife has a Moto G4 and we have unlocked the bootloader, and installed installed the Xposed framework so she can run Xprivacy)

If you can unlock the bootloader on those G4 Plays, You can imstall TWRP recovery and also install LimeageOS

You could in theory then compile and install additional drivers.


Or course Bluetooth is probably a much easier option to interface to phone nowadays.
nRF51822 based BLE boards can be picked up for $5 and they can be programmed using gcc and even the Arduino IDE, but you need a Blackmagic probe or other SWD programmer.

Ollie
Posts: 197
Joined: Thu Feb 25, 2016 7:27 pm

Re: New RPi Zero W - with Wifi and Bluetooth

Post by Ollie » Wed May 17, 2017 12:29 am

I think that it is still a challenge at the application level to have USB connection between the STM32duino and phone. In case of FTC robotics, Qualcom has done the heavy lifting and made it easy to develop the robotics application either with Android Studio (Java) or Android App Inventor (graphic block language). There is even support for Browser based Blockly programming where the phone is acting as a web server for a PC or Mac.

The user interface with two game-pads that are connected to another phone. The two phones are connected together with WiFi direct. I have already done basic reverse engineering of the application interface to USB. My next step during the coming months is to analyze the message details between the phone and the I/O devices. It will be less effort to develop compatible STM32duino devices than to create the whole new application architecture.

In that light, it will be way easier for us to connect the display panels with SPI, UART, and I2C at H/W level than to go through the S/W layers in tablets and phones. Perhaps there will be an easy to use an efficient way for user interface development using JavaScript, Python, Dart, Processing, or something similar against data models in STM32duino.

ag123
Posts: 798
Joined: Thu Jul 21, 2016 4:24 pm

Re: New RPi Zero W - with Wifi and Bluetooth

Post by ag123 » Wed May 17, 2017 5:34 am

these days github is your friend :D
usb serial for android
https://github.com/mik3y/usb-serial-for-android

for the desktop, i'd think processing made a pretty good pair with arduino
just that processing has a rather large bulk some 100 megs for its distribution and some 200-300 megs uncompressed
http://www.stm32duino.com/viewtopic.php?f=19&t=1973

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: New RPi Zero W - with Wifi and Bluetooth

Post by RogerClark » Wed May 17, 2017 7:10 am

ag123 wrote:these days github is your friend :D
usb serial for android
https://github.com/mik3y/usb-serial-for-android

for the desktop, i'd think processing made a pretty good pair with arduino
just that processing has a rather large bulk some 100 megs for its distribution and some 200-300 megs uncompressed
http://www.stm32duino.com/viewtopic.php?f=19&t=1973
Thanks.

It looks very useful.

Post Reply