Difference between revisions of "SpaceAPI:Button"

From Technologia Incognita
Jump to: navigation, search
Line 1: Line 1:
 
{{Project
 
{{Project
 
|picture=spacebutton_acta.jpg
 
|picture=spacebutton_acta.jpg
|ProjectSkills=nanode, arduino, basic electronics
+
|ProjectSkills=OpenWRT, basic electronics
|ProjectStatus=Dormant
+
|ProjectStatus=Finished
 
|ProjectNiche=Electronics
 
|ProjectNiche=Electronics
 
|ProjectPurpose=Infrastructure
 
|ProjectPurpose=Infrastructure
Line 8: Line 8:
 
[[category:SpaceAPI]]
 
[[category:SpaceAPI]]
 
[[Category:Arduino]]
 
[[Category:Arduino]]
 +
= Spacebutton mkII =
  
==Todo==
+
== Hardware ==
  
* Get a better casing
+
The current Space button consists of:
* Integrate with TISSEO(?)
 
* fix network issue. Spacebutton keeps sending dhcp requests, but ignores dhcp replies. Keeps sending requests as an result.
 
  
 +
* an 8Devices Carambola2 dev board, running a custom LEDE(was OpenWRT) linux system
 +
* an industrial stateless button.
 +
* a [[PCB_Techinc_Logo|Techinc Badge]]
 +
* a wired Internet connection
 +
* a USB power adapter / mini-USB cable
 +
 +
== Design ==
 +
 +
[[File:SpacebuttonmkII.svg]]
 +
 +
== Software ==
 +
 +
The Carambola 2 runs a custom compiled LEDE (formerly OpenWRT) firmware with a go program
 +
for the logic.
 +
 +
https://github.com/brainsmoke/spacebuttonmk2
 +
 +
=== Compiling LEDE ===
 +
 +
Sadly, precompiled packages of Openwrt/LEDE do not support MIPS
 +
hardware float emulation out of the box, and the (default) Go
 +
compiler does not (yet) support software float.
 +
 +
Solution: compile LEDE with in-kernel hardware float emulation
 +
 +
==== LEDE with in-kernel hardware float emulation ====
 +
 +
Follow the steps at:
 +
 +
https://lede-project.org/docs/guide-developer/quickstart-build-images
 +
 +
 
 +
  apt-get install subversion g++ zlib1g-dev build-essential git python rsync man-db
 +
  apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget
 +
 
 +
  git clone https://git.lede-project.org/source.git lede
 +
  cd lede
 +
  git checkout -b lede-17.01
 +
 
 +
  ./scripts/feeds update -a
 +
  ./scripts/feeds install -a
 +
 
 +
  make menuconfig
 +
  # select Target System -> Atheros AR7xxx/AR9xxx
 +
  # select Target Profile -> Carambola2 board from 8Devices
 +
  make kernel_menuconfig
 +
  # select Kernel type -> [*] MIPS FPU Emulator
 +
  make
 +
 
 +
  # resulting sysupgrade image:
 +
  # bin/targets/ar71xx/generic/lede-ar71xx-generic-carambola2-squashfs-sysupgrade.bin
 +
 
 +
==== Compiling spacestate ====
 +
 +
  GOARCH=mips go build -ldflags="-s -w"
 +
 +
=== Techinc Logo State Indication code ===
 +
 +
https://github.com/techinc/techinc_logo_avr/tree/master/spacebutton
 +
 +
  make
 +
  make fuses
 +
  make flash
 +
 +
= Spacebutton mkI (This spacebutton is no longer in use!!!!!) =
  
 
==Nanode code==
 
==Nanode code==

Revision as of 20:32, 21 November 2017

Projects
Spacebutton acta.jpg
Participants Brainsmoke, Guido, Realitygaps
Skills OpenWRT, basic electronics
Status Finished
Niche Electronics
Purpose Infrastructure

Spacebutton mkII

Hardware

The current Space button consists of:

  • an 8Devices Carambola2 dev board, running a custom LEDE(was OpenWRT) linux system
  • an industrial stateless button.
  • a Techinc Badge
  • a wired Internet connection
  • a USB power adapter / mini-USB cable

Design

SpacebuttonmkII.svg

Software

The Carambola 2 runs a custom compiled LEDE (formerly OpenWRT) firmware with a go program for the logic.

https://github.com/brainsmoke/spacebuttonmk2

Compiling LEDE

Sadly, precompiled packages of Openwrt/LEDE do not support MIPS hardware float emulation out of the box, and the (default) Go compiler does not (yet) support software float.

Solution: compile LEDE with in-kernel hardware float emulation

LEDE with in-kernel hardware float emulation

Follow the steps at:

https://lede-project.org/docs/guide-developer/quickstart-build-images


 apt-get install subversion g++ zlib1g-dev build-essential git python rsync man-db
 apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget
 
 git clone https://git.lede-project.org/source.git lede
 cd lede
 git checkout -b lede-17.01
 
 ./scripts/feeds update -a
 ./scripts/feeds install -a
 
 make menuconfig
 # select Target System -> Atheros AR7xxx/AR9xxx
 # select Target Profile -> Carambola2 board from 8Devices
 make kernel_menuconfig
 # select Kernel type -> [*] MIPS FPU Emulator
 make
 
 # resulting sysupgrade image:
 # bin/targets/ar71xx/generic/lede-ar71xx-generic-carambola2-squashfs-sysupgrade.bin
 

Compiling spacestate

 GOARCH=mips go build -ldflags="-s -w"

Techinc Logo State Indication code

https://github.com/techinc/techinc_logo_avr/tree/master/spacebutton

 make
 make fuses
 make flash

Spacebutton mkI (This spacebutton is no longer in use!!!!!)

Nanode code

https://github.com/techinc/SpaceButton

(and EtherCard fork) https://github.com/techinc/ethercard

The code uses DHCP to obtain an IP address and find a gateway.

Wiring

The button is a circuit breaker. Connected to pin 3, it pulls this input pin to ground when not pressed.

The code enables the internal pull-up resistor, so no external one is needed.


The LED is connected to pin 5, also using a pull-down circuit. (So the led should be *on*, when pin 5 is low.)

Troubleshooting

The LED blinks:

  • every four seconds: No link
  • every two seconds: No DHCP
  • every second: No DNS
  • twice a second: Changing the space state, but no response yet from the server
  • two seconds on, two seconds off: 'upstream' space state unknown.

Power

The nanode is now powered through a USB-port.

DO NOT power it using 9V. There are some issues with the voltage regulator (which is not used when fed through (5V) USB.)

Notification App

An Android app is available to monitor the current state of the space and notify when it changes. The source code is available on GitHub: Source


The app can be downloaded from Google Play or GitHub


Spacebutton iterations

Spacebutton tmpinc.jpg Spacebutton acta.jpg