Giter VIP home page Giter VIP logo

wednus / hana Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 24.11 MB

Examples for SDK of Hana

Home Page: http://flat.wednus.com/built-for-flat

License: GNU General Public License v3.0

C++ 14.59% Python 14.46% C 31.24% Makefile 3.92% Shell 9.03% HTML 25.57% CSS 0.63% JavaScript 0.07% Lua 0.17% Assembly 0.23% Objective-C 0.08% M4 0.02%
raspberry-pi arduino docker esp8266 fpga iot xbee rs485 machxo2 max7219

hana's Introduction

HackIoT Hana

About Hana

Hana works as an IoT node in stand-alone mode forwarding data to remote partner device, and paried with a Raspberry Pi like SBC, it becomes IoT gateway device aggregating data from nodes and processing them for various applications.

Demo & Toolkit for SDK

This repository contains the demo projects and toolkit for the SDK of HackIoT Hana.

IMPORTANT: The project code here assumes the target SBC's specific H/W (e.g. RPi + Hana) and S/W environment prepared as docker images, and all the images introduced here are freely available readily to be pulled. (docker pull)

How Folders are Structured

Preparation

Assuming you are on Raspbian:

  1. Update the cmdline.txt and remove 'console=serial0,115200'

    sudo nano /boot/cmdline.txt
    
  2. Update the config.txt.

    sudo nano /boot/config.txt
    

    Copy-paste below at the very bottom (for overriding existing):

    dtparam=spi=on
    dtoverlay=enc28j60
    dtparam=i2c_vc=on
    dtparam=i2c_arm=on
    enable_uart=1
    dtoverlay=pi3-miniuart-bt
    
  3. add the 'i2c-dev' to /etc/modules

    sudo bash -c "echo 'i2c-dev' >> /etc/modules"
    
  4. Install docker and flat running the command:

    curl http://host.wednus.com/getflat | sh
    

    For more information: Getting flat

  5. Reboot

    sudo reboot
    

Getting SDK

This section explains how to obtain SDK with examples within docker container environment that everything is already configured.

For a quick video tutorial, watch Getting SDK for HackIoT Hana.

  1. Install Hana SDK

    1.1. Open docker-compose.yaml file

    nano ~/docker-compose.yaml
    

    1.2. Add the 'hackiot' block below in the 'services' section

    services:
    ...
    
      hackiot:
        container_name: hackiot
        image: wednus/hackiot-hana:sdk
        volumes:
          - /sys:/sys
          - /etc/localtime:/etc/localtime:ro
          - /home/pi/hackiot:/workspace
        devices:
          - /dev/mem
          - /dev/i2c-1
          - /dev/gpiomem
          - /dev/serial0
          - /dev/spidev0.1
        ports:
          - 80:80
        cap_add:
          - sys_rawio
          - sys_ptrace
        restart: always
    
     ...
    

    Note: The image 'wednus/hackiot-hana:sdk' contains SDK & this demo projects as well. For SDK without demos, use 'wednus/hackiot-hana' instead.

    1.3. Create hackiot container

    docker-compose up -d
    

    1.4. Open SDK from web browser

    http://[IP Address]/
    
  2. Check the other tutorials and subscibe for future updates:

    HackIoT Youtube Channel

SDK Updater

  1. In the SDK (cloud9) IDE, open 'RPi/flat.hana_upgrade' sub-project.
  2. Open README.md file and follow the instruction.

Getting Help

Links

Pinout

Pinout Diagram

Known Issues

SDK (web IDE) loading takes too long

One drawback of newer docker engines is they take longer init time. (i.e. 8 ~ 12 minutes w/ RPi0) There is nothing fundamentally we can do until the docker fix this or our SBC get much faster. There are, however, a couple of walkarounds to consider before reboot:

  • For faster IDE start
    • Do not close the SDK IDE browser tab and leave it open until it reconnects itself after reboot.
  • For easier wait
    • Run 'docker ps' command and wait until it returns result. (== ready)

      With this, at least, we get to know when the SDK is ready exactly without keep refreshing the browser tab.

Troubleshoot

During AVR upload

  • [ERROR] avrdude-hackiot: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
    • Check /boot/cmdline.txt and make sure the removal of ‘console=serial0,115200’
  • [ERROR] avrdude-hackiot: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
    • cause: /dev/serial0 is not available
    • Make sure there's no program occupying serial0. (e.g. python scripts)

The Last Resort

If all your troubleshoot effort failed, you may want to start over from reflashing the micro SD card.

hana's People

Contributors

wednus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

marceluphd ymz000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.