We test VoCore in hackspace - a micro computer with WiFi on Linux / OpenWrt
VoCore is such a microcomputer with Linux / OpenWrt on board, which more recently, with the help of crowdfunding, collected more than $ 100k (of the stated $ 6k). Inside this trick: 360 MHz MIPS processor, 802.11n WiFi, 10 / 100Mbps Ethernet, and a bunch of GPIO. Everything fit on a scarf size 25x25mm!
Below we will talk about how to make VoCore (this device) perform a simple action in five minutes - turn on and turn off the LED. It is clear that with the help of simple circuits, instead of the LED, you can connect any other load: from a light bulb to a heating boiler. ')
And most importantly, we announce a competition for the distribution of three VoCore to those who offer the best ideas for its use. Details, again, under the cut!
price - approximately 80 Yuan in China (about 500 rubles).
So, we have VoCore (we have received pre-release versions), and there is a firm intention to control something, for example, with a LED.
The plan is:
connect power to VoCore
connect via Wi-Fi to VoCore and log in via SSH in OpenWrt
assemble a simple LED resistor circuit
connect this circuit to the GPIO output of the vocore
implement GPIO output control
flashing LED
Let's get started
First we need to find the specifications for the pins of this board:
Attention , because we have a pre-release version - then in the release version - small differences are possible.
1. Connect the power
We used four 1.5V batteries. We get a total of 5.5V. VoCore can be powered from + 3.5V to + 6.0V.
Since the pins on VoCore have a pitch of 1.27, and not 2.54, then special crocodiles had to be used to work with them.
It so happened that in our example we put a minus on HOLE1 (technical hole for mounting the board) - it turned out that it works like a “ground”. And the GND's lower left legs, in contrast, were not connected to the ground.
2. Connect to VoCore via Wi-Fi and go via SSH
After power on, we wait about 30 seconds while VoCore boots (Linux) and does a Wi-Fi search. Connect to a WiFi hotspot with SSID "VoCore" (who would have thought).
After that we go ssh to IP 192.168.61.1 and log in with the root / vocore details .
We see a familiar picture:
Now we are inside OpenWrt / Linux - inside a coin-sized computer !
3. Create a layout for the LED on the layout.
On the breadboard (without using a soldering iron) we will make a simple circuit for switching on the LED (let's not forget about the resistor).
Here is the diagram:
Let me remind you that in the model boards there is an internal structure of the pin connection - which ensures contact without the need for soldering ( here , it is indicated how the pins on the breadboard are connected)
4. Connect to GPIO VoCore
To control the LED will use GPIO7.
We connect according to the scheme:
Here is our assembled layout:
5. Initialize GPIO
To work with GPIO outputs, we will use GPIO Sysfs - this is the mechanism for working with GPIO as with a file system.
To control the GPIO output - you just need to create an acc. file and write to it 0 or 1.
Perform the following actions in the console:
cd /sys/class/gpio echo 7 > exportcd gpio7 echo out > direction
We switched to the virtual file system - "/ sys / class / gpio", connected the "7" -th GPIO, and indicated its direction "out".
6. Light and dim the LED
Now that the port is configured, we can change the value by writing a value (1 or 0) to the “value” file.
We light the LED, transmitting the truth to GPIO7:
In our hackspace there are 3pcs of VoCore, which we are ready to send for free. For this we are announcing a contest . The main goal of the competition is to see how the VoCore project will become interesting for Habr readers.
The competition will consist of two stages. The first stage will last from now until October 12, 2014. During this time, it is required to formulate the idea of ​​the project, or to show achievements with similar systems (based on OpenWrt or using other microcomputers).
You can apply in two ways: 1) posting a comment under this post; 2) sending a description to hackspace@makeitlab.ru
At the second stage, we will vote on 10 favorite works, and choose the three best ones (from 13.10.2014 to 19.10.2014). At the same time, two winners will be selected by the largest number of votes, and one will be chosen subjectively for the project that is most liked.
The application is welcome: 1) availability of ready-made analogue based on OpenWrt; 2) the presence of analogue on other microcomputers; 3) a detailed description and history of the creation; 4) links to the code if the project is open.
Profile
Also, we had the idea to order a batch of VoCore right at the factory in China. To do this, you need to assess the potential of the market. If you have an interest in this device, do not be lazy, fill out a couple of the field in this form . The more willing there will be, the cheaper VoCore will be!
PS: For the VoCore provided for the test and contest - thanks targence The second thank you so much for the detailed algorithm of pin pulling in OpenWrt we express apatrushev