-
Not space worthy!
08/26/2014 at 16:47 • 0 commentsHackaday monitor and Lighting Box is officially out of the competition!
I'm not very surprised, compared to most of the projects that made the final 50 and to a huge number from those 750 that didn't make it, Hackaday monitor doesn't look like much. I hoped to be in the last 5 of those 50, but the competition was too big :)
Congratulation for every member of the final 50 projects!
Is it over?
No!
My goal for this project is to learn how to finish a simple project from the beginning to the very end. I want to create a product that is consumer ready - well, almost. I don't intend to sell it or anything, but I want to finish it:
- it needs to work without crushing / hanging,
- have a nice enclosure,
- have a user friendly interface.
Those are my goals and I intend to stick with them. Hopefully not having a fixed deadline will allow me to fulfill them all.
What next?
I'll start coding the API for the communication between Spark Core and OlinuXino. I decided to use C++ on the OlinuXino. I was considering Python for a while, however Python's memory usage is much less deterministic than that of C++. Since RAM will be limited, I don't want to waste many hours of programming just to wakeup with random crashes due to memory problems.
I'm considering a change of name. This is because my original idea of Hackaday article monitor was greatly expanded after initially creating the project. I also don't want to set overambitious goals or implement too many features which may prevent the completion of this project . I have to think about this more.
-
Checkpoint!
08/20/2014 at 23:57 • 0 commentsWe've reached a checkpoint in TheHackadayPrize!
In the morning I created the system design required for the first stage of the contest. Later I published Adafruit_Thermal library ported to Spark Core. And now I finished creating a demo of my project, including the required demonstration video... 25 of them... This is the one I think turned out best :)
I forgot to mention in the video the enclosure will be laser cut out of plywood and painted black with RGB LED lighting.
Hopefully this log entry closes the check list of requirements for this stage.
The Thermal Printer
I had some time playing with the printer and it's library. It allowed me to learn a few things about it. For example you can either print a text using a large font or a bold font, not both. An other issue is I cannot print bitmaps on the same line as I draw text, this complicates my plans of having visually appealing prints of weather forecasts and hackaday.com article notifications with a nice skull logo.
The only possibility I see is to generate a bitmap that includes the entire width of the paper on the linux board (logo + text) and send it to the printer. It seems Adafruit_Thermal is prepared for such option with printBitmap(int w,int h,Stream *stream) method. If I have enough time, I will try to implement this, as it seems very fun!
As for the logo images, I used the tutorial from Adafruit for OLED displays that shows how to generate C arrays out of normal images. Unfortunately under wine on linux it generated arrays full of zeros. My solution was to quickly hack my own converter. It did even partially work (see the cloud image printed on the demonstration video). There is some error there I will have to fix later. The code is available in the repository.
The OLED display
While the Thermal Printer was a bit challenging, the OLED display just worked. Everything I was expecting of it, it did provide. All the code worked flawlessly. I guess I will use this kind of displays more often!
The demonstration code
For the demonstration video, I've coded the Spark Core to print a weather forecast and a notification of new article on Hackaday.com. Of course the information printed is hardcoded, but it is just a demonstration. After the print is over, the OLED display is used to display current time and date.
The code is available in the GIT repository. It is currently developed in Spark Cloud IDE, but I think I will deploy a local toolchain so I can work locally in a more traditional fashion. I feel the time between the moment I press "Flash the code" and the moment the code is running on Spark Core is a bit too long, about 3 or 4 minutes. I hope building and flushing through USB will be faster.
What next?
First I'll check if my Olimex OLinuXino-Micro has additional working UARTs (I need two). If it does, it will become the brain of this device. If not, I will be forced to fallback to Raspberry Pi (clearly an overkill for this project).
Once I have a linux board, I will start coding the interface for communication between linux and Spark Core.
I guess that is it. I hope you've enjoyed the video.
-
Thermal Printer on Spark Core
08/20/2014 at 15:55 • 0 commentsPrinting on a thermal printer from Spark Core
As I wrote previously, in order to continue with my project, I had to port Adafruit's Thermal Printer Arduino library to Spark Core. It didn't turn out to be very difficult. As promised, I'm publishing Adafruit Thermal Printer library ported to Spark Core. Here you can see it in action:
I had to modify the API a bit, as well as the example. You'll find more details bellow.
No SoftSerial
There is no software serial on Spark Core. It is not a problem, Spark has already two serials (and a third on the way). That means the Adafruit_Thermal::Adafruit_Thermal() constructor doesn't accept any arguments and Adafruit_Thermal::begin() requires a pointer to a stream object - a serial port. Example:
Adafruit_Thermal printer;
Serial1.begin(19200);
printer.begin(&Serial1);An other thing you'll notice is I initialize the speed of Serial1 manually. I am not sure it is a good idea to put it inside printer.begin(). I may of course reconsider that if anyone has a good reason for it.
No program memory
Since I don't know if or how Spark Core handles data stored in program memory, the fromProgMem argument in Adafruit_Printer::printBitmap() is ignored. That means I only know bitmaps held in RAM can be properly drawn. If anyone knows anything about that issue, please tell me. On the good side, Spark Core has 10x more RAM than Arduino UNO, so hopefully this won't be an issue.
Example code
The example code is mostly the same. The initialization of the serial port is different (see above) and bitmap data that was previously in external header files were moved to the source code. The reason for this is when you try to run the example ("Use This Example" button) from Spark IDE, it doesn't include the header files (it does not know they are part of the example).
This library is published on Spark IDE, so you can use it right away.
If you find any issues with this port, please report a bug on GitHub.
-
Delivery!
08/19/2014 at 22:37 • 0 commentsGreat! Everything I purchased arrived this morning. As soon as I finished my daytime work, I started wiring it on my breadboard. Here is how it went:
OLED display
OLED display worked like a charm on Arduino UNO. I had some minor issues with Spark Core, probably due to my misunderstanding of the cloud based IDE. Anyway after working out the issues, I managed to run Adafruit's OLED examples.
Thermal Printer
The thermal printer is a totally different story. Nothing worked on Arduino. Nothing could have worked on Spark, as no one ported the library yet!
I first tried Adafruit's library. It printed only some dots instead of lines. After a quick google search, it turned out Sparkfun is providing similar printer, so obviously I had to try their examples. This didn't end well. The code was incompatible with my version of Arduino IDE. I wasted an hour or so trying to fix it and still didn't manage to get proper results.
I started to suspect my printer is broken, as even the build-in printer test was failing. It kept printing "CP437" text in a loop. This made me think of a similar problem I had with under powered audio amplifier in my last project (Back To The Future clock). It turned out my 2A 5V power supply connected through a mess of cables was at fault! Because of the lack of power, the printer kept resetting every time it printed something (a line of text or part of line of text).
Once I solved the power issues, Adafruit's Arduino code started to work. Then I ported it to Spark Core (I'll publish the code soon). Now I have a working example running on Spark Core, first the entire print test, then the OLED test.
Spark Core
I managed to run Spark Core and generally I'm happy about it. I feel however very limited by the amount of RAM it has - 20KB SRAM. Seems a lot compared to Arduino UNO, but considering hackaday.com home page has almost 100KB and it's news feed is 40KB, I have to reconsider my plans. Sure one could extract all the information from a stream, but this has limitations too, mostly a lot more code and more it is difficult to test and debug.
Additionally I was suggested today to include prints of weather forecasting including graphical representation of weather. All this requires additional RAM. I'm thinking right now I could add some more powerful board for main logic and use Spark Core as WiFi module and probably interface for the OLED and RGB leds. I have 3 linux boards that could work: Raspberry PI model B, ODroid U3 and Olimex iMX233 OlinuXino Micro. For now the best candidate for the task is the OlinuXino, as it's small, low power device with 64MB RAM. It's only problem is it lacks additional UART (there is one used for terminal) or I2C - at least it looks that way), so I don't know how would it communicate with Spark.
What next?
It's a shame I joined the competition that late, but I'll try to make the best of the time I have left. Tomorrow I'll make a decision on how to proceed with the problem of RAM and I will prepare the demonstration video.
Whish me luck!
-
Starting the work
08/16/2014 at 20:05 • 0 commentsThis is my second project on Hackaday.io. This time I will focus on the end product aspect of the project rather than just playing with electronics.
The goal of this project is to build an electronic gadget device that my wife will approve to put on display in our living room. This means we will have to work on aesthetics a lot - no hanging wires, nice enclosure, usable interface. The enclosure will be made of painted lasercut plywood with LED lighted sides (see bellow) and the control user interface will be presented on OLED monochrome graphical display. Hopefully it will be enough.
Inspired by one of my competitors project during Sci-Fi contest, the Fifth Element Stone Mood Lighting, I decided to throw in some RGB LEDs to light up my project. The idea is to use Adafruit's NeoPixels to light the sides of the enclosure for ambient lighting effects and for notification purposes.
Thought by previous experience with delivery problems, this time I did a complete list of hard to find elements (at least in Poland), and order it with courier deliver (no Post Office this time). Components on the way:
- Thermal Printer
- OLED graphical display
- NeoPixels modules
I already have a Spark core, so that simplifies things a bit. This allows me to work on reading new article titles from hackaday.com home page.
That's all for now, I'll write more soon.