TuxCon organized Arduino Day in PMG Konstantin Velichkov in Pazardzhik

arduino-day

Saturday 16.03.2019 was Arduino Day and celebrated all around the world by Arduino enthusiasts. On Arduino web site there is dedicated page with map where all events are listed.

TuxCon organized Arduino Day in PMG “Konstantin Velichkov” – Pazardzhik. The youngsters were around 20 and we split them in 5 teams with mentors.

eduArdu was used as educational board and it was really pleasant surprise to see how dedicated were all participants – they worked 4 hours and didn’t want to take a rest.

Some of them has never seen Arduino, but studied the existing demo codes and start to modifying them. Some even try to make their own snake game on the LED matrix. Another nice code was done for controlling the eduArdu RGB LED remotely with cell phone via the IR receiver, we expect these codes to go as pull requests to our GitHub repository soon 🙂

eduardugame

Obviously their teachers did good job, no wonder they got so many prizes:

prizes.jpg

TuxCon is open to organize such events in other schools too, if you want your school to have similar event please contact TuxCon.

 

Linux Users Group Bulgaria annual meeting is April 6th in Plovdiv

LUGBG_1

Linux Users Group is annual meeting of people who use and develop with Linux in Bulgaria. The LUG-BG meeting this year is on 6th of April in Plovdiv. The web page of the meeting is here.

I signed for discussion about how to make one ARM Linux system tamper proof.

This is topic which is very interesting for all our OLinuXino customers. OLinuXino is used in many industrial product and machines and the designers want to be sure that no one except them can change the Linux image as these machines pass safety approvals etc and any intervention in the code is illegal.

The Allwinner SoCs do have TrustZone support and also crypto hardware to support a secure boot path for it, but parts of the ARM TrustZone specifications is under NDA and no one has seen it. The secure boot paths are also undocumented. Last time I attempt to receive any useful information about this I got reply: A20 is 5 years old processor and we do not offer technical support for the old processors, when I asked them for info how TrustZone and Secure boot is implemented in their newer processors I didn’t got any reply. My guess is this is something licensed from ARM which they never used so can’t support.

Currently all Allwinner SOC boot without using TrustZone and Secure boot path, they has so caller BROM a small code located in SOC ROM, which initializes the memory and processor registers with some safe values then try to boot from different peripherals. If UBOOT GPIO is held low they enter FEL mode where you can type some commands and load code via USB, else they try to boot from SD-CARD, if fails then try -> internal NAND Flash if fails then try -> SD-CARD2/eMMC, if fails then try -> SPI Flash, if all fails it go in FEL mode.

This is done intentionally so you can never brick your board if internal NAND or EMMC or SPI Flash get corrupted you can always boot from SD-card or USB and replace the image. This of course is big security hole, as anyone with physical access to your board can always replace your images with his own.

The TrustZone and Secure boot path solve this issue, but no one has documentation how this is done on Allwinner SOCs.

I hope to get some interesting ideas how this could be solved, one radical approach is to remove physically the SD-card connectors 🙂

NES emulator on ESP32-POE + MOD-LCD2.8RTP

 

esp32-nes

ESP32 NES emulator allows you to run your old games on ESP32. We modified it to work with MOD-LCD2.8RTP which has touch panel so you can use it as NES controller:

touch-buttons

The modifications are included in SOFTWARE section of ESP32-POE but the example will work with any of our other ESP32 boards which has UEXT, like ESP32-EVB and upcoming ESP32-POE-ISO.

Here is video for ESP32 NESEMU in action:

Next step is to add UEXTx5 and connect MOD-Wii-UEXT-NUNCHUCK as controller.

A64-OLinuXino got mainline Linux Kernel 5.0 images

Linux-Kernel-5-featured

Linux kernel 5.0 was just released and as we were working this week to the release of mainline Linux image for A64-OLinuXino (as till now it has the ugly android based 3.10 kernel) we decided to release latest kernel.

The images are available on our FTP.

There are two images Debian headless or Ubuntu desktop.

Known issues with these images:

  • LCDs are not supported yet, HDMI output is only available, we need one more week to figure out how to automatically detect if the Ethernet or LCD are enabled (there is jumper on the board which switch between LCD or Ethernet as both share pins and can’t work together). So to make the DTS configurations  automatic at boot time.
  • eMMC do not work in the fastest possible mode yet. We need some time, right now 50MB/s is the max speed to read write instead of 100-200MB/s which the installed eMMC supports, we will update the image soon with HS200/400 modes enabled.
  • No CPU thermal. A64 has 3 thermal zones – CPU, GPU0 and GPU1. The driver doesn’t support monitoring them.

How to build the images is explained here.

Mainline Linux Kernel 5.0 images for A13, A20 and A33 OLinuXino and SOMs is in progress.

Open Source Hardware ESP32-POE board now has new version with 3000VDC galvanic insulation

ESP32-POE-ISO

ESP32-POE is one of our best selling boards, it’s low cost less than EUR 18 in single quantity and allow you to make IoT sensor network with existing Ethernet POE infrastructure.

The end node can provide up to 4W combined on +5V and +3.3V output to external components and circuits which is more than enough for most applications.

To simplify the design and lower the cost ESP32-POE has no galvanic insulation.

Some customers asked can we add such insulation – sure it’s possible, meet the new ESP32-POE-ISO. So here above on the picture you see first samples of the insulated POE board.

We wanted to keep is as similar to existing POE as possible, as you can see the new board is just 15 mm longer and keep same pinout on the connectors, allowing ESP32-POE to be directly replaced with ESP32-POE-ISO.

What are the benefits? Now you can safely debug your ESP32-POE-ISO while connected both to computer with USB cable and Ethernet POE cable.

For the insulation we use 2W DCDC converter with 3000VAC insulation. The available 400mA are split between ESP32 and external circuit and in most application will be sufficient.

The price of ESP32-POE-ISO is EUR 23.95 (only EUR 6 more than non-isolated ESP32-POE) in single quantity.

If 2W are not enough, we can produce same board with 3W DCDC which allow 600mA current, but the price will rise with another 3 EUR to EUR 26.95 in single quantity.

LoRa experiments in Plovdiv

Screenshot from 2019-02-20 12-24-46

We are working for some months on OSHW LoRa nodes and our goal is to bring up free to use for non for profit Smart City solutions LoRaWAN network which to cover city of Plovdiv .

Yesterday we installed our First LoRaWAN Gateway made with T2-OLinuXino-LIME2-e16GBs16MB + RK831 + +6dBi rod antenna on Rilon Building which is about in the city center and with height good for antenna installation.

You can see on above map – the “Raspberry Pi” is hardcoded in RK831 firmware but do not worry there is industrial grade Linux computer in the gateway.

 

rilon

We start experimenting with our LoRa868 and MOD-LoRa868 modules and made portable GPS tracker device like this:

LoRa-GPS

The results are nice. We cover almost 2km circle around the antenna. With few spots which are shadowed by tall building.

range

The secret in the big distance is the good gain gateway antenna!

We really are impatient to release these LoRa gadgets as soon as possible, but unfortunately it takes much more time than we expected.

There were lot of issues with the Semtech/ARMmbed reference designs like the RF part of their 868Mhz design actually has components values which make 915Mhz device and vice versa. We spent weeks to understand why the communication distance is not as good as expected, before we realize that we use 915Mhz LoRa nodes with 868Mhz antennas! Once we get everything complete and tested will put our boards on the web for sale and publish OSHW their correct schematics and component values, so other will not waste their time like we did.

One issue we encountered with RK831 Gateway is that it freeze from time to time when receive malformed packets and need to restart. As RK831 firmware is not open source we can’t debug the cause of this problem. The workaround now is when host lose connection with gateway just reboot latter. Really not most elegant solution, but so far we can’t do anything else.

We are preparing two more Gateways to install in the next days, which will cover more parts of the city.

 

 

C awesomeness (not)

The_C_Programming_Language_logo.svg

Few days ago I was asked question what would be the output of this code:

#include <stdio.h>
int main()
{
      int a = 5;

      printf("%d %d %d %d\n",a++,a++,++a,a++);

      return 0;
}

Nothing special, right? But C standard do not specify how printf evaluates it’s parameters, so it’s left up to the C compiler and here the fun part starts.

Old C compilers would be a bit more predictable as they would start evaluating from the top of the stack to the bottom i.e. right to left, but the new ones heavy optimize and try to execute some instructions in parallel, so the only certain thing is that at the printf “;” point of synchronization “a” would be incremented 4 time, but nobody knows in what order.

Compiled with GCC/Code Blocks the output is:

Screenshot from 2019-02-20 11-46-45

Again nobody guarantee that if you re-compile on different computer /CPU the result will be same!

Even changing the code with one more line like enter the value of a with scanf leads to different result:

Screenshot from 2019-02-20 11-47-47

So good practice will be to avoid any calculations inside printf and to search logic there. Do these separately where compiler has to stick to C standard and rules.

 

Previous Older Entries Next Newer Entries