Part 2: Modules and AppStore. ESPboy - a gadget for retro games and experiments with IoT

Since the publication of the first article about the ESPboy device I designed on the ESP8266 microcontroller, quite a lot of time has passed.





However, something was done during this time:


  1. Bring the device itself to the production stage
  2. Build expansion modules, write software for them and debug
  3. WiFi Apple iStore Google play market
  4. Arduboy Arduboy ESPboy
  5. Little Game Engine


Comparison of ESPboy with M5Stack, MeowBit & Dingoo A-320



The solder itself was already fed up and managed to negotiate with the excellent Chinese guys from www.makerfabs.com , who brought together a couple of dozen half-assembled kit-kits for independent final assembly. The quality turned out great, for which many thanks to them. It is necessary to solder only 4 parts to make it work.



He quickly handed out a test batch for tests for those wishing to participate in the development of the project, and we need to order more, but you need to figure out how to deal with customs control. If you find several devices of the same type in one package, there is a risk of delay and lengthy disassembly.



Expansion modules and software for them


Next, we managed to collect prototype modules and write for each software, which turns ESPboy into a full-fledged device, as intended. To do this, just plug the desired module into the expansion slot and update the firmware. Sources on github .



There are several more iterations to bring all the modules to the production stage.

It is necessary to draw printed circuit boards, make verified lists of available and inexpensive components, write detailed instructions, arrange everything in the form of whales, ready for assembly and in the form of already assembled products.

I hope to have time to do all this before the end of this year.

For today, the following extensions are fully prepared and debugged:

  1. Full mini keyboard
  2. Meteo Station
  3. MP3 player
  4. FM radio
  5. GPS navigator
  6. DAC module for playing music
  7. LORA messenger
  8. GSM phone

Also in the work are some more interesting ideas, I hope to tell you soon.

A few words about each module


1. A full-fledged mini keyboard

Based on the keyboard of the Blackberry Q10 smartphone, which is controlled through the MCP23017 port expander.



There is quite a lot of information about the signals on the keyboard loop and the task is to order a connector + adapter for the cable and solder this connector to the adapter. Given the size of the connector in a few millimeters and the size of the contacts themselves literally from the hair, the task is not an easy one.

MCP23017 works on i2c and there were no problems in the software plan. It is necessary to interrogate the keyboard matrix for the search for closed contacts and correctly interpret the signals in the keyboard layout. Details are visible in source codes .



2. Meteo station

Which arduino worker did not collect the weather station. You will not find such a thing in nature.
My version uses an i2c pressure / humidity / temperature sensor BME280 and also a CO2 sensor - SGP30 .

As a bonus - DC3231 real-time clock , which also allows you to display the correct time.

It was still thought to add a lightning / lightning sensor AS3935 , but a little expensive. Maybe later.



The module itself turned out to be small, the code is here .

As an extended version, I made a bigger piece on the test. I didn’t like it, but the video of the experiment was preserved.



3. MP3 player

Used DFplayer mini mp3 , in the same way that is described in articles about this module .

The only problem with it is that defective people often come across and do not work stably or do not work at all. Source code .

4. FM radio

As a basis, the fm tuner module SI4703 and a slightly doped library from mathertel were used .



The radio plays quite tolerably in headphones, the search for stations and even RDS works. The code is here.



5. GPS Navigator

Nowhere to go without navigation. Therefore, of course, I decided to assemble an additional module for this task.
I used the WAVGAT GY-NEO6MV2 chip with which there were absolutely no problems. Implemented two ekarana. One is the free navigation mode, the second is the mode of following to the point from the memory. Theoretically, you can put a map there, but this is a long task. The source code is still there .



5. DAC module for playing music

When developing the ZX Spectrum emulator, the idea arose to emulate its musical coprocessor AY-3-8910. Software emulation on the built-in dynamics turned out, but the processor costs for sound synthesis and quality left much to be desired. In the end, the Spectrum on ESPboy earned, but only in the 48k version without AY emulation because even enough memory was available end-to-end (literally a couple dozen bytes per stack remained).



However, thanks to the efforts of Shiru and his experiments with sound , a DAC module for ESPboy and a PT3 player AY-3-8910 Spectrum music appeared.

The module was used on PCM5102 with support for the I2S interface (not to be confused with I2C ). There are always source codes .



7. LORA messenger

Not so long ago, the LORA technology , an energy-saving protocol for transmitting short data packets over a long distance radio channel, has become very popular . I rummaged around and discovered inexpensive transceivers from EBYTE .

And at maximum power they sharash as much as 8km in line of sight. Here you need to understand that obstacles in the form of terrain and urban development dramatically reduce this indicator, well, urban noise, too. However, in suburban conditions, or if satellites with GSM towers, for example, fall in, this is an excellent communication channel. The experiments resulted in the creation of a full-fledged chat module over the air. The module itself encrypts the packet, but I’m also on top as an AES option (this is disabled by default).

Had toTo get confused with the library under the transceiver because the existing ones were either buggy, or I did not understand how they even work.





8. GSM hacker phone

Having stumbled upon the Ringo phone designer (formerly Maker Phone) on the network , I was very surprised at the price and complexity. Having experience with the well-known SIM800 modules from the company SimCom, he quickly washed down his phone.

Of course, it is not as convenient as everyone’s favorite modern smartphones, but it doesn’t peep and steal your contacts.





The written software supports the necessary minimum:

  • Current time display
  • Answer calls and drop calls
  • Dialing a number
  • Receive and send SMS

In addition, the screen displays all the service information on the operation of the GSM transceiver. Requests and responses of base stations and hell knows what else. I'm not special, but it's interesting to watch.

As a bonus, you can enter low-level AT commands to control the transceiver, as in the good old days of dialup modems, and these commands are 600 pages in the documentation from SimCom . Well than a research field for true white hat hackers.

ESPboy App Store - Online Application Catalog


Studying the ESP8266 documentation and remembering about WiFi on board, I was especially struck by the ability to update its firmware via http / https , that is, over the network. Considering that programming microcontrollers is a troublesome task, and updating firmware is almost always hemorrhoids, I really wanted to change this.

What does the firmware update for the microcontroller look like in the usual way?

  1. If USB-TTL is built in, then consider yourself lucky. And if not, then you need to look for a separate USB-TTL converter and figure out how to connect
  2. Connect the device with a wire to the computer and configure the driver
  3. Install Arduino IDE
  4. Install ESP8266 extension under Arduino IDE
  5. Download source code
  6. To understand which libraries are used there and which versions (which is never obvious)
  7. Search and download all libraries of the necessary versions and install them (and this, in principle, is not always possible)
  8. Deal with compilation options, set them (which is also not obvious)
  9. If you finally managed to get to compilation, get a bunch of errors
  10. Perform dances with tambourines, solving compilation errors (sometimes this happens more than one day, and even with grated kalachami sometimes get nerves)

It’s clear that it’s difficult for beginners to master such a quest and this is a critical obstacle when entering the topic of microcontroller programming, rotobotechnics and other such.

And how can this be changed?

The online application catalog itself reduces the task of updating the firmware to the following simple steps:

  1. Select a WiFi network from the list
  2. Select an application from the list
  3. Wait half a minute

Well, is it not beauty and happiness!

Here are the source code of the client part to connect and enjoy .



Arduboy2 Library Port


About a year ago, after he had designed ESPboy and tested it with might and main, he came across a commercially successful Arduboy project .

Under this wonderful gadget, as it turned out, not a few cool open-source games were written , and a friendly community is developing to this day.

The development of games for Arduboy is based on the Arduboy2 lib library .

After porting this library to ESPboy, it became possible to recompile dozens of great games with Arduboy with minimal code adjustments.

Library sources, ported games and instructions on how to port anything from Arduboy to ESPboy, again on github.



New games on Little Game Engine


In parallel with the ESPboy project, the Little Game Engine console fantasy project is being intensively developed .

The work of games made on the Little Game Engine is supported by ESPboy and Igor, the author of the engine, does not cease to please us with new releases .

The development of these games is simple and straightforward, and is also available to anyone through the development environment (IDE), which runs in any browser and has a built-in compiler and emulator .

Game sources are open, visible in the IDE when choosing a game, and are available for editing and experimentation. To play, you need to select “compile” above the game code, and then click the “play” icon on the left side of the emulator window. The “C” description of such an LGE language is also very detailed.

The source code of the engine itself is also available for review.



Thus, work on the project continues.

There is still a lot of interesting things. And the addition of new elements of the ESPboy ecosystem and the more thorough integration of existing components to simplify the work with the device, both for users and developers.



Thanks to everyone who contributes to the project: Dmitry (Plague) , Alexander (Shiru) , Mikhail G.,
Igor (Corax) , Alex (AlRado) , Mikhail (Torabora), Andrey S. , George P., Roman (orsweb ) , Scott (MLXXXP) , Haroldo (Haroldo-OK) , John E , Marcus de Verdier , Loopingstar , AccidentalRebel and many others who play, read, test, code, stream, advise and just like.

All good and creative success!

Regards,
RomanS

All Articles