Saturday, July 18, 2015

Finally Made Fly Snap Mobile to connect to ADB shell using USB cable

As part of my IoT/Home-Automation/Home-Monitoring exercises, I was exploring various low cost Android phones that do following:

  • GPS monitoring -- Tracking the Cars/kids/etc
  • Video Camera(s) -- for Video monitoring
  • BLE -- For any IoT
  • Have Android 4.4.2 and above
  • Have minimum 2 ARM cores and 512 MB Ram
I found/bought following Android phones are reasonable VFM for these purposes:
  • BQ S38  ( 50$ ) : 2-core-Cortex-A7, 512MB Ram, 4" IPS, GPS, No BLE , Android 4.4.2
  • Fly Snap ( 50$) : 4-core-SC7731, 512MB Ram, 4", GPS, No BLE , Android 4.4.2
Though I was able to connect BQ S38 via ADB from my Fedora-15, I am not able to connect the Fly-Snap to ADB-server. It seems there are some drivers for Windows at these links:
I could not use them, as I am not using windows and using Fedora-15 :(

I added following lines to /etc/udev/rules.d/52-android.rules:
SUBSYSTEM=="usb", SYSFS{idVendor}=="1782", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="1782" ATTR{idVendor}=="4012"  MODE="0666", OWNER="yyyy"

1782 and 4012 are takes from command 'dmesg'. Then as root, I issued 'udevadm control --reload-rules'.


But I was not able to connect Fly-Snap. So as another step, I added following line to ~/.android/adb_usb.ini
0x1782

But Then I killed adb-server using 'adb kill-server' and 'adb start-server'. Now I am able to my Fly-Snap device.

Sunday, March 1, 2015

Launchpad can survive on 1000mAh LiPo battery for 1.5 years with Radio Link to RPi board

So after last few days of work on data serialization across Rpi & LaunchPad (MSP430G2553), I integrated the Serialization library that sends couple of 32-bit /16-bit integers from MCU to RPi via NRF24L01+ chip.

Initially MCU was raking around 230uA current . After some tweaking, it came down 130uA .

As final optimization (for this round of testing), I shutdown the NRF24L01+ chip till next time radio-packet-transmission. This step lead to MCU current consumption of 25uA . So in this period (approximate 12 seconds) MCU is in LPM3 sleep-state and radio is in shutdown-state. When MCU wakes-up, it activates NRF chip again & sends radio-packets, during this tx-period, it takes around 400uA for a breif period.


So taking on average current consumption of 50uA (including radio-packet-tx current bump), using battery life calculator for 1000mAh LiPO battery's life is around 14000hours (583 days). Not bad for a starter project :)

I have just documented the initial video for the same at youtube .


I will be submitting the code in github in coming days after stabilization and cleanups.
I will do same test for MSP430F5969 (FRAM board with Super capacitor on it).

Friday, February 27, 2015

Finally able to make Raspberry to talk to MSP430 via NRF24L01+

As a part of my future IoT projects, I was trying to create reusable libraries and utilities for Arduino, MSP430, PIC, Freescale and STM32 processors using Nordic NRF24L01+ wireless transceiver chip. Ultimate goal is to make cheap sensors (that cost less than 7 to10$ including sensors & batteries) that could be deployed in any IoT, HomeAutomation, etc projects. I was planning to use Raspberry (or any cheap Linux board or cheap Android sticks -- future goal)  as my central observer of these cheap nodes.

Here are some  major tasks that were necessary (apart from HW):

  • Circuit diagrams that make connectivity
  • FW for Linux box and MCUs
  • A Data Serialization library for MCUs and Linux box

After lots of trials and tribulations (with limited amount free time after my office/home jobs), I was able to talk Raspberry with following devices (in initial setup scenarios):
  • MSP430 LaunchPad with MSP430G2553
  • MSP430FR5969 LaunchPad
Idea is to make Raspberry as to receive the radio packets from all sensors ( MSP430s, Arduinos, PICs,etc) and this Raspberry connected to network via LAN and WiFi.

As a next step for proper communication along these wide variety of MCUs with different endianness, I need to create small library in C/C++ for packing all types integers (uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t ) and chars.  As I could not get this from web (with whatever search strings I gave), so I created  small library for doing this job. At present this works on Linux (so that Raspberry can understand what wireless nodes are sending), MSP430G2553 and MSP430FR5969. All UT was done for most generic corner cases, I shall be using this for my home IoT framework.

Once I finish more tests and my system, I will publish code at github:
  • Raspberry to MSP430G2553 
  • Raspberry to MSP430FR5969
  • Generic C based Data-Serialization library for Linux/MCUs
I will also publish circuit diagrams for:
  • Raspberry to NRF24L01+
  • MSP430FR5969 to  NRF24L01+
  • MSP430G2553 to  NRF24L01+