Call me! (with Adafruit FONA)

09 Sep

Call me! (with Adafruit FONA)

About a year ago, Adafruit launched the FONA. It's a neat little breakout board that packs all the features you'd want in a phone such as Calling, SMS, Data and Lipo battery operation and charging. Add to that a good API that is easy to extend and we have a winner.

By itself, the module can't do much, so you'll need a microcontroller of some sort. My preference is using a Teensy 3.1 since these are just incredibly flexible, fast & cheap. They're also small and placement friendly. By now I've used the FONA for two commercial projects and I thought it'd be nice to collect my experiences in this post.

Call for pizza using the ad on a bus station

The first project had me build the FONA into an advertising board. Check this video to see it in action. The large timer was connected to a motor that pulled it slowly back to zero. At each end position of the timer, there was a manual switch that triggered the FONA in different ways. When the timer was set to 15 minutes, the Teensy set the FONA to call up the pizza delivery. If the person turning the timer wanted, they could get a free pizza within 15 minutes. When the timer was set back to Zero, the Teensy prepared the FONA for the next customer.

As can be seen in the video, it was a snowy morning and I got to do some extra troubleshooting in the bus shed since the timer motor accidentally burned out the evening before and the replacement motor made so much electrical noise that it messed up the sensing on the button pins. I solved this by moving the button pins to analog pins and using a different threshold than the normal digital I/O used.

The FONA used a normal headset-mic to pick up the sound. To play it back I used some more Adafruit components - a 3.7W amplifier and these neat transducers. Despite being only 5W, it was not a problem to hear the sound on a busy Bus-stop when attaching the transducer firmly to the board itself. While the person waited for their pizza, we also played them some cheezy elevator-music. This came from the Teensy using the Audio Adaptor board. I really dig this board. So many cool audio things you can do. Really powerful!

The installation stood there for a whole day and worked without any issues despite the moist weather.

Call anywhere in the world for free!

The second project had us set up a telephone booth that looked kind of like a 1.2 meter tall iPhone. It was to promote the mobile provider MyCall and the idea was to make a phone booth where you can call for free (3 minutes at a time). JCDecaux also made a nice video for this one that highlights that the campaign gave 30% boost in sales.

The interface to the user was a 47" touchscreen showing a multi-screen AIR app that communicated with a Teensy 3.1 via Serial. Before calling, the user was asked to input their existing phone number. After their free call was finished, we used their phone number to send them a polite SMS telling that MyCall offered great prices on calls abroad (their specialty). The project stood outside in a very public space (outside the Oslo central station) for 10 days and worked without a single error. I'm really happy with the stability of the FONA/Teensy combination!

Both projects were done for JCDecaux with MesseTjeneste making the enclosures and me doing the software + electronics.

Fona tips and tricks learned

Here's some things that are nice to know about FONA that you won't find on the (as always) solid tutorial pages on

A lipo battery is indeed Required
The FONA needs a battery to be able to source the required power upon connecting to the network. A 2.2A / 5V dedicated power supply was not enough, but a half-charged 150mA lipo in addition to the USB connection did the trick. The lipo battery is now added as a requirement on the FONA product page.

GSM calling produces serious EMP
Once a call was placed or the FONA connected to the network, the audio chip in the Teensy Audio board was completely messed up. It produced random and unpleasant audible noise. I solved by moving the FONA away from the Teensy, putting them in two separate boxes. I also tried shielding them from each other, but I got very varying results. Much easier to just move them away from each other.

Not all SIM cards will work
I initially picked up a dirt cheap SIM card at a kiosk and it worked right away. This was from MyCall, the company I later made the kiosk for. I then needed to make a copy of the installation, but when I tried to use a SIM card from Norway's largest telco Telenor, it didn't work.

The SIM worked like a charm when inserted into a phone, but on the FONA I was unable to connect to the network. The SIM unlocked successfully, but I was denied access to the network. I later learned that holding down the KEY button for 20 seconds can solve this.

Library only covers some
I needed to blink some lights while a call was in progress and play some audio when the call ended. There currently isn't a method in the default library to check this, but all I had to do was to look up the SIM800L datasheet to find the required AT command.  I then looked through the Adafruit code to see how they had implemented similar features and added this (gist). It's all just serial AT-commands that are wrapped nicely. Super simple!

Using Teensy
Since the Teensy has several Serial ports, you may need to make some minor changes to the default FONA sketches and lib. I've detailed these in this gist.

Ideas aplenty

My initial thought seeing the FONA was to build a phone, but I still haven't done that. Instead, I've used it for installations. Using a phone rather than wifi or bluetooth has advantages and drawbacks, but there are some pretty cool things you can do with this. As an example of something I'd love to do:

  • Imagine an interactive window display controlled via SMS?
  • Using it as a transparent network access point?
  • Click-this-big-button-to-talk-to-support/sales?
  • Circuits that allow you to check status or remote control vending machines or controls? It would be really simple to make a machine send an SMS if it fails to do it's task, so it can alert you that it needs service.
  • It could also be perfect for simple surveilance of hunting spots or beehives in rural areas where there's no phone coverage
  • Turning on the heat at the family cottage via SMS

It's so many cool things you can do with this when you don't need to think about having wifi available!

I really dig how easy it is to build connected installations with the FONA board and it looks like others also think so since Adafruit has now expanded the range to also include a board with a GPS and some convenient starter packs. I'm looking forward to play much more with FONA in the future!

Fixing avr-eclipse paths

20 Aug

Fixing avr-eclipse paths

Just before summer, I started consulting work for a hardware startup here in Oslo. As part of this I've gotten to play around with and integrate lots of new toys such as VISA card readers and various communication solutions. I also inherited some AVR code for a circuit developed specifically for the project and yesterday I set up the tooling.

I guess I could have used all sorts of software alternatives to program the microcontroller, but since the people that created the codebase used Avr-Eclipse, I figured that I'd check it out. Using a GUI makes finding the right fuse settings a breeze and I love to have proper syntax highlighting and completion. Setting it up was easy using this guide, but getting the code to compile properly was somewhat difficult so I thought I'd jot down what I learned in case it helps others.

Setting path for AVR tools in Eclipse

All my problems boiled down to Eclipse not using the PATH variables for avr-gcc and avrdude. On my system I have CrossPack installed for working with pure AVR projects and then I typically use the Arduino tool + Sublime for anything Arduino-related. The Arduino tool automatically adds some things to PATH on the Mac/OSX so in theory, avr-eclipse should just find and use this. It didn't. Instead it pointed to an old, uninstalled version installed by MacPorts on my old Mac that got ported over to my second Mac. All the folders were empty as I unsinstalled MacPorts to use Brew instead several years ago, but the "smart" feature insisted that these empty folders were better than looking at the system PATH variable. I altered the PATH values to point to the CrossPack installation but that didn't help either.

The creators of the avr-eclipse plugin have tried to add some smarts to the configuration, but that failed completely for me. To set the correct location of the AVR tools you want to use, open the Eclipse menu > Preferences and then expand AVR > Paths like this:

Forget the Rescan button if you know what path you want to use. If you don't know the path to avr-gcc and the other tools, just open a terminal window and type:

which avr-gcc

This will tell you the path of the avr-gcc that can be reached through the normal PATH settings on your machine. Now you'd think that this is all you need to do, right?

Fixing the standard includes

I kept getting errors like this.

undefined reference to `debug'
undefined reference to `asm'

It basically means that AVR-eclipse can't find the class definitions for these files. To fix it, Right Click the name of your project in the Package Explorer window and select Properties at the bottom of this menu. This brings up the local preferences for the project. Go to the "C/C++ General" entry and expand the "Paths and Symbols" option. Make sure you're linking to the right version of the include files here:

If you've set the correct AVR hardware and the right programmer, you should now have a working setup. Hope this helps someone as it was rather hard to google all the bits required to get to this.


Testing with Testflight

10 Jul

Testing with Testflight

After Apple purchased Testflight, the service has been integrated into the workflow when publishing apps. Any app with a distribution profile can be sent to users for testing and the process is actually quite smooth compared to the old version. First your build is vetted by Application Loader (or XCode) and then you turn on testing for that specific build. I did however run into an issue worth publishing in case others run into it.

Normally, you'll just flick a switch to turn on Testflight Beta Testing and the app is ready to be tested by all internal to the team. In my case, I could flick the switch but nothing happened. I called Apple Developer support, but the guy I talked with completely failed at understanding what my issue was and he insisted on sending me something I knew was incorrect. He just wouldn't listen when I tried to tell him that something was wrong:

I eventually understood that the first of the two warnings (... must contain the correct beta entitlement) did not have anything to do with my certificate or provisioning file, but rather a missing directive in my app descriptor. Some googling led me to this article that explained how one had to add the beta-reports-active key to the Entitlements part of the descriptor. I now got an error when uploading the 

Build 168 does not contain the correct beta entitlement.

After reading all the replies to this thread I realised that I should not set the mobileProvision-file to be for AdHoc distribution. It should just be a Distribution profile for App Store. That's it.

I also had another issue getting my AIR app published this time. After updating to the latest XCode, I got the following error when uploading the app:

Invalid Bundle: The bundle does not support the minimum version os specified in info.plist

Turns out one have to add a bit about MinimumOSVersion to the InfoAdditions-section of the descriptor file as well. My entire iPhone descriptor settings are now like this:


Popcorn Time!

06 Jul

Popcorn Time!

Just a little summer sigh... I keep reading articles like this one (translated to English) about the famed Popcorn Time software that let's anyone view pretty much any movie when they want. In this article, the word "strømming" means "streaming" and the headline is that streaming of pirated movies has more than doubled the last year.

Nobody but the movie industry is surprised! We all want to stream movies like we've been able to for music for quite some time now.

In my opinion, Popcorn Time is Netflix done right, but without any legal issues holding them back. Suing Popcorn Time or it's users will not solve the problem. Just as with music - new distribution models will pop up and they'll be your competition in the future. The longer you wait, the worse you basically make it for yourself.

How NOT to attack this

The obvious way to attack this is what the movie industry is currently doing. They slam the Digital Millennium Copyright Act in the face of those pirating instead of removing stick (or even forest) in their eye. They drag kids and parents to court for illegally watching movies. I wonder why one have to work in IT / Web to understand that this will not solve a single problem? Why can't they just understand once and for all, the old distribution model is gone and they have to solve this with software & licensing?

What the movie industry SHOULD do

First of all, they should read this 7 year old review from the EFF of what happened when the RIAA sued more than 30.000 individuals. They gained nothing, but rather lost their public reputation as a watch dog for the industry. People don't pirate movies or make services like Popcorn Time to be evil. They are solving what the industry does not do itself - the obvious way to distribute movies.

There is no practical reason not to distribute movies digitally. There may be legal / monetary issues regarding the licensing of each film, but that is irrelevant to the end users. When the music service WiMP (now part of Tidal) started here in Oslo, they had 1 programmer and 8 lawyers. That's how clumsy these things are in music. I don't expect it to be easier with films, but that's no reason to hold on to an antiquated system? The first studio to clear legalities and make their ENTIRE back catalog of movies available will be the winner.

For several years, record labels report about increased purchase and use of music - thanks to the streaming services. As soon as Hollywood understands that they can activate their massive back catalog of assets, they will make the illegal streaming services will disappear - just as the P2P music pirating disappeared. The first company to make a Spotify for movies (offering movies from most or all studios) will be filthy rich.

Nobody really wants to pirate movies. It just happens to be easier than getting them legally.

Image by Tim Cowley, CC By-SA 4.0


Including Native extensions on OSX

01 Jun

Including Native extensions on OSX

Making a small GUI project that controls some hardware today and stubled upon a bug that I solved when using the neat COM-port extension for AIR by Nick Kwiatkowski.

I got the following error upon compiling:

Process terminated without establishing connection to debugger.
Not supported native extensions profile

This comes from the AIR project being set to target all platforms by default. By adding the "supportedProfiles" tag in the application XML, the problem will disappear:


This solves the first problem, but you'll most likely get another one:

Process terminated without establishing connection to debugger.
The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.quetwo.Arduino.ArduinoConnector could not be found.

This comes from the Native Extension not being included with the project by default. Right click your Project -> Properties -> Actionscript Build Packaging -> Native Extensions and check the checkbox under Package. Flash Builder may incorrectly claim that "This ANE is not used in the application". If all goes well, your project should now compile.

Also be sure to read the old FAQ on Google Code to get your Arduino Connector project up and running on both Windows and Mac as you'll find that the DLLs pthreadGC2.dll and libgcc_s_dw2-1.dll are required.

Filament review: Printing with potatoes?

26 Apr

Filament review: Printing with potatoes?

One thing that fascinate people about 3D printing is the fact that the PLA plastic we often use as material is made from Corn. Now you can get a bioplastic made from potatoes as well! In this review of the bioplastic called Biome3D I'll highlight how it prints and how it differs from other materials. It has some quite useful properties!

The majority of PLA available comes from the company Natureworks. They sell the raw material to plastic manufacturers that add colorants and other chemicals to achieve their desired properties. The Corn based PLA most often used for 3D printing is the Ingeo 4043d grade but you can find other variants and producers.

The potato based bioplastic I'm testing here, is made in the UK by the company Biome Plastics and it's primarily sold through the website 3DomFilaments. I initially purchased some samples, but I picked up a couple more rolls since I wanted to test some more.

Not as brittle

The first thing I noticed is that it's nowhere as brittle as PLA. This is a major advantage. When you take a piece of the filament and bend it, it acts more like ABS. It bends and becomes more white in color. You won't break it until you bend 10-12 times. The material is strong and allows quite some bending before it breaks. It's not anywhere as tough as PET though, but much more suited than corn based PLA for applications that will be experiencing any degree of flexing. It is still stiff and solid and it barely shrinks at all. 

When printing, the layers bond really well and I can extrude it nicely all the way down to 175C - a very low temperature for my printer. It also has a nice, matte shine to it and theres basically no smell when heating the material. What I find the most fascinating about this material is how different it looks from other filaments when extruded!

Different consistency

When this material flows out of the nozzle, it behaves different than other 3D printing filaments I have. If you just push material out of the extruder, it will not hang as a nice, thin string. Instead, it will become a "lump" that gets a "skin", but keeps filling from the inside with hot material until the lump becomes so heavy that it falls off and create a new lump. Check the video below to see what I mean.

In other words, this material seem to "store" heat longer than other filaments. You can very much feel that if you try to squeeze one of the lumps of plastic that fall down.

The Biome 3D filament goes soft at 80-90 degrees, but you can print it at much lower temperatures than most other materials. As can be seen from all the horizontal stripes in the picture at the top here, cooling is essential. My printer is currently in the middle of a conversion to dual Flex3Drive (Writeup on this brilliant tech soon!) so I barely have any cooling. This shows clearly as lines along the prints. Lowering the temperature helps a lot and it prints well down to rather low temperatures.

Post processing!

This stuff can be sanded! Normal PLA will melt as soon as you start sanding or polishing it, but the Biome material seems to have a high enough Glass Transition temp that you can actually work it quite a bit before it deforms. That means that normal sanding is possible, but also tumbling with various mediums.

As can be seen above - my lack of cooling causes stripes in the print. I didn't sand the piece in the middle all the way down as the grooves were quite deep, but you can see how well it works. PLA will heat up and melt as soon as you sand it, but the Biome 3D filament holds up well as long as you don't repeatedly sand the same spot. I was even able to sand it using a Dremel as long as I kept moving to allow some cooling. It is impossible to polish the material to a shine like you can for ABS as it's matte by nature. I have not tested how well paint sticks, but I'll do a test and add that here later.

I can't find a proper datasheet, but the ability to sand the parts made me think that the Glass Transition temp was higher than the 70C typical for other PLA and lower than the 110C for ABS. I did some testing by submerging a printed part in 70C tap water. This revealed that it does indeed deform at this temperature and it also deformed at 60C. At 55C the object held up, so a Glass Transition temperature of 60C seems likely. That's actually lower than some PLA variants and makes it unsuited for parts that are exposed to heat. In other words - this won't replace ABS as a way to print spare parts for your dishwasher or similar tasks.

I also tried flame polishing the material. It does bring out a gloss but it's extremely hard to not apply too much heat. Since the heat builds up inside the material, I managed to get what looked like a perfect finish, but then after a few seconds it looked like above. The heat in the material kept melting it... I also tried to treat it with acetone, but it has no visual effect. It does however seem to dissolve the plastic to some degree.

All golden?

Now this seems all very cool, but there must be some negative things also? Of course there is, but they're not that bad. If you follow the manufacturers recommendation and use a heated bed at 60-70C, you'll see the prints sag at the bottom (Elephant's foot). I've actually seen this in all my prints to some degree, despite lowering the bed temperature to 40C. Like said before - a lot of cooling is required when printing with this plastic as heat is "stored" in the plastic. In other words - extra fans may be required.

Another thing that might be more of a problem is the inconsistencies I found with the spooled material. The diameter was quite consistent (+/- 0.2mm on my 2.85mm filament), but I had one case where it was way above normal (3.2mm). The material is spooled in a way so that it does not unspool perfectly. Towards the end of the roll it actually managed to pull my extruder back across half the build platform when the steppers turned off. This is probably easy to remedy and they've just started producing filament so they'll surely fix this. They should however also fix this:

Melted onto the filament was a lump of plastic from the production. This would have ruined the print on any printer. I happened to notice it, but you really don't want to see stuff like this. The material comes in the colors white, black, red, yellow, blue, green and pink so the selection isn't exactly stellar, but this is sufficient for many. Only opaque colors exist for now, so no translucent yet. When I purchased, I was first sent 1.75mm plastic despite ordering 3mm. As a compensation, they gave me half a roll of another color - so while the webshop isn't completely routined, they do offer good customer service.

In other words - I like the filament, but they need to ensure the quality is consistent. With that, I think this can be a good replacement for the fossil ABS filaments. I especially like that you can sand it and that it's more flexible than ABS/PLA!

BAMM settings for Biome3D filament

The BAM Makeblock printer has a Flex3Drive extruder with a Hexagon nozzle. I use the following settings with this material:

  • Temperature: 175-190C
  • Speed: 50-100mm/sec
  • Retraction: 2.5mm
  • Extruder tension: normal
  • Heated bed: 40C
  • Fan: full (& then some)


Beta testing for Makeblock

01 Apr

Beta testing for Makeblock

Some weeks ago, I was asked by Makeblock if I wanted to review a kit that they are putting on Kickstarter? I guess they asked my since I've written about some of my other Makeblock experiences and use it for most of my robotic projects, and of course I wouldn't mind testing out something new. But - I got an idea - who better to test it than my 10 year old daughter Vera? They liked the idea and sent the kit off.

Disclaimer: the kit was given to me, but because of Norwegian customs regulations it is impossible to get anything "for review purposes". Due to that, I had to pay both handling fees & vat of the theoretical price, making it a fairly expensive project, but hey - I get some quality time with my daughter & she get's to make another robot!

First day - rough start

The kit came in one of those nice, blue Makeblock boxes that I have a few of already. As soon as the courier arrived with the package, my daughter started asking what day we were building? Due to family plans, the first day of building took a few weeks to work out. 

The kit is quite impressive when you lay out all the parts - stepper motors, beams, wheels, nuts-n-bolts, electronics, sensors.... It's a really solid kit and it is the foundation of no less than 4 different robots. It's quite an ingenius little kit in that it contains all the kinds of drawing robots that you'd want to build - a pantograph arm-style robot (mScara), a Polargraph wall-drawing robot (mSpider), an egg-bot for drawing on round objects (mEggBot) & a PenBot (mCar, same kind as the NITH Penbot I designed some years back). Vera very soon found out that she wanted to build the mScara robot first!

The day arrived and Vera thoroughly liked hanging at Bitraf (my local hackerspace) a whole day while building! The deal was - she would test the kit and I would sit next to her working on something else. If she got a problem, she would ask me for advice. Turns out, she needed a lot of help. The reason? We only had a video of the robot being dis-assembled and no instructions on how to build it. I contacted Makeblock and they said that unfortunately that wasn't finished yet but we could get it very soon. 

Oh well. It was after all Saturday so she had candies while she mounted the electronics and peeled the foil off the plastic parts. We had planned another build-day and this was after all a Beta test, so we could not expect it all to go perfectly smooth.

Second day - success!

About two weeks later, we had another build-day at the hackerspace and this time we had instructions! This day, Vera kept building and only asked me twice for advice so the instructions were rather good! The only things she asked about where "Do I use this length or this length screws" and other simple things. At the end of the day, we got the robot working and she chould start drawing!

We'll keep exploring the kit in the weeks to come, but we really like it already. Vera's reaction to opening it was that of a kid opening a massive box of candies and the software makes it a breeze to change between robot configurations. Vera did not think it was difficult to build the robot at all. She has a little LEGO experience that I think came in handy, but I think this kit would work for all kids that enjoys tinkering and building.

Judging by the Kickstarter campaign, it's not just Vera & I that thinks this is a cool kit! For now they've reached their goal and it's well on it's way to reaching the first stretch goal of $100.000 grin

ESP8266 and stability

24 Mar

ESP8266 and stability

Like many others in the Maker Community I've spent a lot of time playing with the dirt cheap ESP8266 wifi chip. It is the cheapest way to add wifi to your project and it's easy to get hold of. My hope was that it would be solid enough that I couldbuild permanent installations and fun Internet Of Things (IoT) devices with it, but the darn thing keeps crashing. I've been testing it since the 0.91 firmware and all the way up to the current 1.0 version and it's not possible to keep the device running for a prolonged period of time.

I've spent more than a weeks worth of time getting it to not crash at random intervals, so I thought I'd share what I've learned in case others find it useful.

Setting up for development

The best way to hook up these dev boards is to use the ESPlorer software (java) and getting a USB to Serial converter. If you have a version that offers 3.3V on both data and power lines (such as this one), it is the most convenient. If you can't find a 5V USB to Serial, you should know that the Serial pins (RX/TX) are supposedly 5V tolerant, but the power must be 3.3V or you will fry the chip. The ESP modules will pull a couple hundred mA, so powering it from a good 3.3V power source such as a LM1117 / LD33 can be a good idea.

There's many guides to hooking up the various development boards, so I won't detail that part, but lets look at the software side of things! When you buy the ESP-01 breakout boards from ebay, you never know what version of the firmware it comes with. Most likely it will be an old one so you'll probably want to update it. But - what firmware should you use?


NodeMCU is a firmware that adds a LUA layer on top of the (somewhat stable) official 0.95 Espressif SDK. This seems to be the most stable firmware you can currently use and it is also the one that is the easiest to get started with. It is well documented and offers good tools. Rui Santos has a great guide for hooking up an ESP-01, burn the NodeMCU firmware and setting it up as a webserver.

Briefly said, you hook up the ESP directly to a USB to Serial converter (3.3V!), download the NodeMCU Flasher tool, select the COM port and hit the Flash Button.

When that is done, download the ESPlorer software to talk to it. LUA is a very straightforward language to learn and if you're used to closures like in Javascript, you'll feel right at home. NodeMCU has a nice, documented API and several libraries that you can add for special hardware like LCD's, WS2812/2811 LEDs, sensors and more.

The NodeMCU firmware is based on the original Espressif SDK and thus inherits all the bugs it comes with. This means that the hardware will crash just as often, but since it always restarts after a crash, it will re-run your LUA script on startup. This makes NodeMCU good enough for devices that will just send some sensor data to a webservice such as Thingspeak. It will not work as an access point doubling as a webserver though. It'll crash and hang just as often as with the original firmware, so for me this is a showstopper. I want to make IoT gadgets that serve up a web interface as well as an open API.

Stock firmwares

Updating the firmware is quite easy if you use the NodeMCU Flasher. This has a nice, minimal GUI and everything is point and click. It's Windows only though, so if you like Python, check out the esptool. All the officially Espressif SDK's contain a "bin"-folder that has the precompiled files and a text description of what memory addresses to copy each .bin file into.

My initial idea was to use the UART in the ESP boards with a Microcontroller. Most my projects are based around the Teensy 3.1 and since it has 3 serial ports, so it's a breeze to do UART communications with. However, no matter how hard I tried, I couldn't make it 100% stable. After a few hours, it just crashed and restarted. It could run fine over night, but it would always crash after some usage. If there was a lot of traffic, it would crash more often and my intent was to basically bombard it with data continuously. I tried all the different versions of the firmware and even the official 1.0 version that was released this week is buggy beyond repair. It is actually so buggy that Espressif recently started an official bug-hunt...

That pretty much rules out using the official firmwares. How about making your own then? Espressif provides an SDK and the required code to compile your own version. Building it yourself is quite easy if you have a Ubuntu VM. Just follow the instructions outlined here. This will however not solve all your problems. Some of the codebase is Open Source, but other parts are provided as "binary blobs" so you can't really know what bugs are hiding inside. You can however exclude those parts of the Espressif SDK that you suspect to be causing the problems, so if want to program the ESP8266 directly check this neat guide on Hackaday.


This "Transparent Bridge" is the solution I'm currently experimenting with. It's a completely dumbed down firmware that can take a TCP connection on any port and relay it to the Serial port (RX/TX). Just apply power, connect to the WiFi access point that it sets up, Telnet to the default address and you can set it up to join your local network / access point. You can then up the BAUD rate to whatever you want/need and change the Port to for example 80 to make it work easily with browsers.

Anything sent to the ESP will then show up on the Serial connection. When you write back to a connection, you can serve data (like a webpage). Currently, this seems to be the most promising solution, but it requires some more testing. The basic idea is to use as little as possible of the buggy Espressif SDK as possible. To get the ESP Transparent Bridge firmware onto the device, just load the premade .bin files using the NodeMCU Flasher tool like this:

I'll post back here when I have more details & results on this setup.

But why care if it's buggy?

You might ask yourself - why on earth should one care about this chip if it is so buggy the creator has to host a competition to find all the bugs? The thing is - at $2 you can put wifi into ANYTHING! A typical wifi-shield for an Arduino will cost you from $30 and up to $90. Just a plain breakout board from Adafruit will cost you $35 and the CC3000 that it's based on isn't exactly stable either. A $2 chip that works would open up so many possibilities, so that's why I still care after fiddling this much with it.

A little about the hardware

I presume that you already know a bit about the hardware if you're reading this. If not, here's some details. The ESP8266 is a small powerhouse and this is a small 101 on the hardware. It's an ARM processor that runs at 80Mhz and can be overclocked to the double. It has up to 16 GPIO pins available and it does SPI, I2C, UART & more in hardware (fast!). It offers great range and you can get one for as low as $2 on ebay. Physically, it is a tiny 5 x 5 mm Integrated Circuit that needs a little supportive components around it to be useful. There is a series of dev-boards that offers this: ESP-1, ESP-2, ESP-3, ESP-4, ESP-5, ESP-6, ESP-7 and so on, all the way up to ESP-12. They differ with regards to pin spacing, internal/external antenna and the number of GPIO pins broken out. It was hard to locate all the pinout diagrams, so I've gathered them all in a github repository that I'll fill with useful code and resources. The original datasheets has some decent info, but check the ESP8266 wiki for more details.

The ESP-1 is typically the cheapest and most available. It only has 2 I/O pins broken out and uses 2.54mm headers. They are however clumsily combined into a 2x4 arrangement making them impossible to breadboard. It's not hard to make an adapter, but the ESP-2 is more practical for breadboard use. This also has a third I/O pin broken out, but requires an external antenna. The different versions all offer useful features, but the ones to avoid are ESP-5 and ESP-10. These do not have the pins required for updating the firmware exposed.

The version that seems to attract the community is ESP-12. It has FCC certification, RF-shielding, ADC and 9 GPIO's. It is included in the NodeMCU devkit that you can now get from TronixLabs and several other Open Hardware vendors. I'm looking forward to getting a couple of these to play around with. Other devboards that look interesting are the new one's from Olimex.


Spark Core shows solid magenta LED

12 Mar

Spark Core shows solid magenta LED

I've been head deep into a great game-project where I'm using UNO & Fuse for the first time on a commercial project. Before this, I spent about two weeks making a nice LED sign that will be used at Bitraf above our mini-hackerspace-shop called Bitmart. I want to be able to control this using any phone so I spent a solid amount of time getting various ESP8266 boards play nice with a Teensy 3.1. That turned out to be a nightmare. I originally intended to make a library around it, but I gave up. They are simply too buggy and running the auto-update makes it corrupt itself, so I now have 4 dead once's that I'll have to flash.

How hard can it be? I tried using the CC3000 from Adafruit with the Teensy instead. It went better, but it did by no means become very stable. Turns out the CC3000 chip is so buggy that even the makers (TI) have given up on it. Too bad that I bought 3 of these boards then... What next? Well, work took over and now that I'm wrapping up the game project, I'm back to this project again. What next?

Spark Core

I've done 45+ Kickstarters and some of them have been for Arduino-like things. One of these is the Spark Core. I never played around with it when I got it, but figured I'd check if that could solve my wifi problems. The Spark Core also has a cc3000 chip, but it's all in one board with an ARM M3 processor to control it. Since the release, the Spark team has put out two new products (Photon + Electron), but since they're making a living from their first product (for now) they've ironed out some of the Wifi problems with the CC3000.

So I followed the instructions and .... nothing. The "smart-app" wasn't smart enough. I updated the Core via USB / terminal so it had my wifi-credentials, but it failed to connect. The LED went from white, green, white and then solid magenta. This state isn't described in the docs so I asked via their forums. Within 15 minutes I got the info that I needed - since my core was an early version, it did not have the required firmware to connect to my WEP2 wifi. A firmware update would solve this.

Updating the Spark Core and DFU mode

To install the command line tools, I had to clean out a very old version of Homebrew from my Mac, but from there it was smooth sailing. First follow the instructions on setting up the development environment (Node.js, npm, homebrew, spark software) then follow the "Deep Update" instructions. To put the Core in DFU-mode (to allow firmware updates) You have to hold both buttons and then release the Reset-button. This will make it blink yellow so you can do the update:

    spark flash --usb deep_update_2014_06 

After running the update, I could then connect it and use it. Thanks to ScruffR for the solution! Posting it here for Google to grab it as I didn't get any good search results solving this.

Nice to have both wifi and MCU on one vs two boards! Teensy 3.1 with an ESP8266 in the back, Spark Core in front.

Unpacking the Titan 1

16 Jan

Unpacking the Titan 1

I just received my fourth 3D printer and the first to use SLA technology. I've followed maybe ten 3D printer projects on Kickstarter, but Titan1 is the first one where I have actually ordered a device. On the other one's I've just been part to follow the project and see if they're posting "the right things" and this was the first vendor to gain my trust. As opposed to most other KS printers, the people from Kudo3D kept posting different reviews of materials and showcased prints.

But without any further ado - here's my unpacking of the printer!

Boxes ahoy!

I received two boxes and for once it was actually true that they didn't fit inside my rather large mailbox. The smaller box contained the printing resin from MakerJuice. The big one contained the printer itself in a nicely packaged box. The upper layer had slots for the Z-stage, two brackets, the RAMPS & some tools.

Beneath this upper layer was the printer-case itself along with a white box containing tools, cables and the red acrylic enclosure:

The printer enclosure was jammed full of other boxes that fit snugly.

I pulled it all out and spread it across the table and here's what the different parts are (click to enlarge):

1. Acer DLP projector
2. Two PSP containers
3. Solid case based on 20mm T-slot extrusion and panels that you just click on/off.
4. MakerJuice! The four bottles of printing resin that I ordered extra.
5. A standard Ramps 1.4 + Arduino Mega controller is used to move the Z-stage.
6. Pre-mounted Z-stage
7. Brush + small air pump for cleaning away dust.
8. Mounting brackets.
9. Starter kit (detailed in next image)

10. 12V/5A power supply
11. Red tape for joining the acrylic pieces
12. American Power cord? Oh well, I have one spare but this one had actually been damaged (pins displaced)
13. Tiny foldable funnel
14. Spare mounting brackets for the T-slot case. One of these + a screw had come loose during transport.
15. Case fan
16. Calibration Ruler
17. Parts for the red, acrylic enclosure
18. "Leveling feet", a fancy plate consisting of a sandwitch of plastic & metal.
19. Hex wrench for case
20. Knob
21. DB9 serial cable extension
22. Feet for the case
23. Flush cutter. Looks good!
24. Tweezers & a stanley knife blade. No knife though?
25. Triangular level
26. Metal spatula
27. Nuts and bolts
28. USB to Serial cable
29. HDMI cable for the projector
30. USB type A cable

I'm really looking forward to get this up and running over the weekend. There should also have been a UV lamp in the package to use when curing the prints as they come put of the printer. I'll email the support dept and check where that one has gone. As usual there's more pictures on my Tumblr page.