Category Archives: Seeed

Grove LCD RGB Backlight

tmpD3E6Now, before anyone says anything – no I’m not advertising Seeed or their Grove stuff. It just so happens that over the weekend my pal brought some of their stuff over to have a play with and I was particularly taken by the LCD display. This is a typical Hitachi-style 16-character by 2 line LCD of the type that have been floating around since last century but which still are popular today I guess because of price. Anyway, this one marked “Grove-LCD RGB Backlight v1.0” is not particularly cheap but it has an RGB LED background and runs off I2c.

We tested it using the Seeed Studio WIO boards (more on that later). Lovely – want a pink background, or how about aqua, or mint -  well, you have full control over the RGB background with values 0-255 for each colour. It occurred to me that this really transforms the otherwise boring LCD display as you can use colour to indicate alerts etc.  For example on a thermostat display you could use orange for on, green for “reached set temperature” and blue for standby.

tmp52FBAnyway, as the WIO modules are little more than an ESP12 I thought it might be more useful to incorporate a driver for this display into my own ESP8266 code. Those of you familiar with the home control project will know that I keep updating the code for the Home Control 2016 project. So – I took a look at the Grove driver for this display – sadly it is in Arduino C++ format so I ended up doing quite a bit of changing to make it do what I wanted and in C – but ultimately it is in there and works a treat. Here are the new commands you can fire out in MQTT to the board with the new software on, using as usual GPIO4 and 5 for I2c.

{rgb_lcd_setup}

{rgb-lcd_clear}

{rgb_lcd_cursor:X,Y}

{rgb_lcd_background:RED,GREEN,BLUE}  // values 0-255 in each case

{rgb_lcd_write:”Your text”}

And that’s all there is to it. A nice addition to the code. I could add more if needed but I figured this minimal set of commands will do for most purposes.

I’m sure there will be other, compatible boards out there – if you know of them – do let us know.

So on the subject of the Seeed WIO boards, I’ve made a separate blog to follow on that – turns out that if you want to have a play, you can blow their code into an ESP-12 – but read the article coming soon.

Facebooktwittergoogle_pluspinterestlinkedin

BeagleBone Green Wireless

Beaglebone GreenThe BeagleBone Green Wireless is the result of a joint effort between Seeed Studio and Beaglebone.org. It is based on the open-source hardware of the Beaglebone Black and they’ve added 2 Grove connectors. You might recall I did a blog on the Grove stuff a while back – basically the usual sensors for temperature, humidity, moisture along with relays etc., all on nice little boards with a standard connector.

Important items here are: WIFI and Bluetooth, AM3358 1Ghz ARM Cortex A8 processor, 512K RAM, 4GB EMC, 3D graphics accelerator, NEON floating-point accelerator, 4 x USB 2.0 connectors. https://www.seeedstudio.com/item_detail.html?p_id=2650

If you check out the Seeed site they have all of the little adaptors and so here is a system you can put together with minimal or no soldering.

Planned shipping 31st May – price $44.90. Apparently Mouser and Digi-Key are distributing internationally and NKC Electronics in the USA.

So this isn’t going to be one of those “gee this is wonderful” reviews – I’ll comment as I go along – it may be nice, it may be brutal. The first thing that grabbed my attention was 512K of RAM – I don’t know why people do that when the leaders out there like Pi have 1GB but I guess it all depends what you want to use these boards for.

So, enough of the official press release stuff, here’s a photo taken this morning on my bench as I took a first look at he BeagleBone Green Wireless. Clearly they want you to use this with their other modules (though you don’t have to) because as well as the two 4-way connectors on the side, there’s a plug in board with a TON of connectors.

BeagleBone Green Wireless and top hat

I’m quite at ease with a soldering iron personally but plugging these two boards together (see photo above)… well, I can see the attraction – they’ve sockets for EVERYTHING on there – as you likely can’t read them – the 12 sockets are:

2 UARTS, 2 analog inputs, 4 digital I/O (totalling 7 I/O pins) and finally 4 I2C sockets… now as it happens I just bought a couple of I2C I/O expanders so straight off I can get 16 extra (well, 14 when you take off SDA and SCL) outputs for a couple of quid!! The switch on the left lets you switch between 3v3 and 5v and I’ve not figured out what the one on the right is yet.

BeagleBone Green WIFI

There are 4 USB 2 connectors on the left of the main board, Power is micro-USB and there’s an on-board ceramic WIFI antenna.  3 buttons include reset, power and user. The board is the same size as a Raspberry Pi (but rounded) and there are 5 indicator lights in a neat row. At the bottom there’s a 6 way connector which basically is power and serial I/O. There are also a couple of connectors for external antenna.

All very pretty. I powered it up.

A blue light over on the right of the image above started to flash along with a green light upper left.  At this point I had no SD in.

Before long a plethora of lights were flashing and after several seconds this settled down to a blue and green lights over to the right – and one green and 2 blues on the left (top behind the USB sockets above).

As I often do – I got this far without reading a thing. Could I go further? With no HDMI out I wasn’t that sure what to do next without cheating and reading online – so off I went to check for WIFI access points on my phone. YES – “Beaglebone80997” showed up. I signed into it, picked a web page at random and sure enough my phone came up with a VERY pretty home page.

My WIFI is called “wififorus” and I was a bit confused to find that the board was seeing half a dozen of them with numbers on the end – no idea why but I picked the first one – put in the password and also it wanted a “board password”  - I was unsure what that meant but assumed a new password – so I put one in. That worked.  No visible change in board lights but I was told the board was now 192.168.1.33

Remember this is all played by ear. I hit OK and a page of instructions came up on the web page – this was all looking very polished up to now. All in good English as well.

It told me that the board was running with Debian, Linux drivers for countless USB gadgets and that there is an interactive tutorial. I think this info is for the BeagleBone BLACK as it was mentioned. There’s even a script for flashing outputs… right there at the start.

The Cloud9 IDE is supported so that you can develop live on the board… somehow I didn’t think that would work too well on my phone – so I opened a browser on the PC to the address given.  At first nothing but just as I was getting despondent…. the page popped up on my browser – all local. Call me easily impressed but this is one of the first boards I’ve reviewed (and I’ve done a lot of reviews but not Beaglebone) where everything worked as expected without having to read anything up!!!

support build in

I remember one of the guys telling me that I should update the software – so off I went to updates… (remember the board was merely plugged into USB for power and I was doing this on my PC browser – what could be easier).  Here are the instructions as read off the board.

The following was me going down the wrong path but I’ll included it anyway.. if you can’t be bothered with a sob story – skip to “The right path”.

The wrong path:

There are multiple ways to run initial software on your board, but it is likely that the simplest way to get an update is to create an exact replica of a bootable microSD card and boot off of it. The BeagleBone Black Rev C has 4GB of eMMC storage (2GB on previous revisions) that can be initialized by a program booted off of a microSD card. If you want to update to the latest software image for your board, this is a way to do that.

Step #1: Download the latest microSD card image

Download "Angstrom Distribution" from http://beagleboard.org/latest-images.

Note: Due to sizing necessities, this download may take 30 minutes or more.

The Angstrom Distribution ships with the boards. The file you download will have an .img.xz extention. This is a compressed sector-by-sector image of the SD card.

ANThe second item down was for various boards including the Beagle Green Wireless – this is nice as often when you get a brand new board (released this coming weekend) there’s zilch out there for it… but in keeping with my experience so far this is looking painless. 775 Meg to go – time for coffee…..

And then it all went wrong for a second…

To turn these images into eMMC flasher images, edit the /boot/uEnv.txt file on the Linux partition on the microSD card and remove the '#' on the line with 'cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh'. Enabling this will cause booting the microSD card to flash the eMMC. Images are no longer provided here for this to avoid people accidentally overwriting their eMMC flash.

I don’t have the foggiest idea what that paragraph above means. Thankfully elsewhere there were instructions for unzipping the file with 7-zip – that produced an .img file – and I know what to do with that – WinDiskManager !!!!

Sure enough – the image wrote successfully to one of my 16GB micro-SD drives. That gave me plenty of time to drink my coffee. I blew the image – and realised that unlike a Pi image – the result was unreadable by PC!! This was starting to turn ugly.

I pulled out my trusty WINSCP and put in the IP address. I had no idea about username or password so picked one at random. The board started to connect then popped up a window telling me what the username and password were “debian” and “temppwd” – handy! I put that into WinSCP and up I was up and running!!!

With only the vaguest knowledge of Linux I plugged in the microSD into a USB adaptor and plugged that into the board. Yet another light came on – this time a green light near the USB socket. 

GroveEncouraged by this success I went off looking for devices… in /home/debian I created a directory called “petes” (as I write this I just know this is all going to fall to pieces as I haven’t a clue what I’m doing).

I then tried:

sudo mount /dev/sda1 /home/debian/petes

I have to tell you – I was DEAD CHUFFED when it actually worked. Maybe all this reading about Linux is doing some good after all. NOW hopefully I could follow the instructions. Sure enough there was a boot/uEnv.txt file. Of course TYPICALLY I didn’t have permission so I had do go into a terminal (instead of WinSCP file few) and use that awful NANO editor.. “sudo nano /home/debian/petes/uEnv.txt”

The problem then was – the instruction above – line starting #cmdline  - simply didn’t exist.

image

The right path:

Anyway it turns out that in trying to update the eMMC memory, I was using the wrong IMAGE – I asked SEEED support and they came back very quickly with a user forum which had the link to the latest image. I blew that onto an SD and tried holding the USER button down while powering up – SURE ENOUGH it updated the eMMC and then I could run the board without the SD in place. Magic.

I just happened to be looking at the online documentation when I noticed a reference to NODE-RED !!! Well, quite excited I clicked the button and it promptly tried to run Node-Red but with the wrong IP address. I corrected that and sure enough, Node-Red came up.  But here’s the thing – Node-Red with NODES FOR GROVE!!!!

In all the reviews I’ve done – I have never seen a board come out of the box already kitted out with Node-Red and full support for I/O – the nearest is the PI with Pi GPIO support – ALL of the other boards I’ve tested just left you to get on with it.

Could I be this lucky? I didn’t get any sensors with the board but I just happened to have a bunch of them from some time ago. I plugged in the top board and of course that immediately killed the processor. I should know better. I rebooted the board and shortly thereafter tried again – Node-Red came up.

I plugged the relay into one of the GPIO connectors – marked 115/117. I dragged the relay node – and… there’s a helpful PICTURE!!!! Now why can’t others (like me) do that…

node-red

I selected GPIO 115  (seriously!!!) and added two inject nodes – one sending 1 – the other sending 0.

injects

It WORKED.  I tried the temperature sensor and that produced a strange value – then I realised – that my temperature sensor though pin compatible was not the one they had in the photo – fair enough and again – good idea including pictures!!!

I tried the servo – I had one of those – none of the connectors on the top seemed to match the pin selections so I picked the first 4-way connector on the main board. I made 2 injectors – one outputting 0, the second outputting 100.  IT WORKED… straight out of the box, no soldering – I had a servo up and running. This is FUN!

I don’t have all of the sensors and I noticed that some of the little modules I have don’t appear to have nodes for them – at least not out of the box. I will revisit these at a future time.

I tried the LED output – there are – wait for it.. SIXTY FIVE OUTPUTS!!!

And that – is that for now. I need to get more plug-in sensors etc. to give this a good hammering..  but if you ignore my incompetence with the setup – we’re talking out of the box to having gadgets running on Node-Red in – what – MINUTES.  This then from the perspective of someone absolutely new to Beaglebone and this board – is a TOTAL improvement on previous experiences I’ve had with boards. I’ve reviewed lots of them and of course I’m a Raspberry Pi addict – especially with the extra power of the 3, but given that I’ve not even read the documentation – to get this far in so short a time with so little effort…  I’m WELL impressed.

Summary:

Between ease of use and online programming this is a good board.  Normally I would install my own Node-Red. In this case it is pre-installed with the various modules to control their boards.

So one might think it would be easy to just add one’s normal nodes to Node-Red? By default I initially could not add nodes – even though trying both globally and normally, the directories were created – the nodes were not added to Node-Red.  I could not start from scratch as that would mean losing the control nodes they have fitted.

Then I discovered that the settings.js file at /usr/local/lib/node_modules/node-red could be altered (as root – which initially has no SCP password but once logged in you can use passwd root in a terminal to add one)

Uncomment and modify the file as such..

nodesDir: '/home/debian/.node-red/node_modules',

After stopping node red (again as root  - service node-red-stop) and then restarting (service node-red start) – my BIGTIMER sitting in /home/debian/node_modules/.node-red-contrib-bigtimer  appeared (I created /home/debian/.node-red  and had previously installed the timer from there).

From there, as the DEBIAN user, I was able to install the various nodes I would normally use – including the admin node (the global version didn’t work so I tried the local version and that installed.

I did however have issues installing some of the nodes – unusually i had to install them as root – and SQLITE3 node was just NOT having it – I also noted that all of this took longer than a Raspberry Pi 2 and MUCH longer than a Raspberry Pi 3. MQTT also failed to start up – even though Webmin SAID it was starting it up.  Clearly there is some setup here interfering with what would normally be a simple setup.

I hope you found this useful. For more see here – officially announced today - http://www.seeedstudio.com/

Facebooktwittergoogle_pluspinterestlinkedin

Linkit Smart 7688

Linkit Smart 7688

This is interesting… so in the post between Christmas and New Year I received one of these in the post. The Linkit Smart 7688 arrived in the form of a small box about the size of a box of matches.  The unit itself is a PCB with metal screen (note the various CE and FC marks for those interested) and is around 25mm by 58mm.

Linkit Smart 7688Like many others, I’m lazy so I only half read the instructions. This WIFI-enabled tiny unit has a built-in router for setup – no, not just a couple of pages setup – a full OpenWrt router with web interface! Well that was the first issue – just plug it into your computer, select the WIFI access point and you’re off – except that my computer doesn’t have WIFI – why would it – it’s a desktop computer! So got the phone out instead.

I plugged the unit into USB power (there is also a host mode connector for attaching memory sticks etc) and around 30 seconds later a new access point appeared on my phone – and I selected it. The online instructions give an access point IP address of 192.168.100.1 so I picked that. Sure enough – on the phone I got a really pretty screen asking me for a new admin password which I promptly gave.

The next step was to upgrade the software from the MediaTek labs website – that would have involved transferring a file to my phone after downloading it onto the PC – thankfully the software on the board was fully up to date – so that was that step sorted.

Linkit Smart 7688The next step involved getting PUTTY on a PC to talk to the board. Well, the PC of course was on the hardwired network – while the little board had it’s own local address so that wasn’t going to work. 

On the mobile phone display I noted a link to OpenWrt – so I followed that and sure enough this tiny little board has a normal-looking router on it (well, normal for something much bigger) – I have to say I was well impressed!

Next: get the unit running on my network – it turns out that was easy enough – I selected client mode and put in the password for my network and the next thing I knew I was looking at a Linux PC accessed by WinSCP – amazing – you could fit at least 3 of these into the space of a Raspberry Pi!!

 

Linkit Smart 7688Of course you were supposed to do all of this with Putty but I’m used to WinSCP – which has Putty attached to it – would it be that simple? – invoke Putty from WinSCP as usual? I clicked the button and…

Yes, it WAS that easy. Don’t ask me what all that stuff about drinks is on the right – someone’s sense of humour I would think. The important point is that this is a Linux command prompt.

Anyway, armed with the built-in shell, I decided for once to follow the instructions. This thing has PYTHON built into it and so..

python /IoT/examples/blink-gpio44.py – hit ENTER – and didn’t the light start flashing!

In the examples directory I found this..

import mraa
import time

x = mraa.Gpio(44)
x.dir(mraa.DIR_OUT)

while True:
    x.write(1)
    time.sleep(0.2)
    x.write(0)
    time.sleep(0.2)

 

So I tried messing with the example and sure enough I could alter the timing and re-run within seconds.

So right now we have a REALLY easy way to flash a light…. for around £7 or 8 that’s a tad expensive – but of course that’s just the beginning…

Here’s the spec.

580Mhz MIPS CPU

WIFI

Pin-outs for GPIO.,I2C,I2S,SPI,UART,PWM and Ethernet Port.

32MB of Flash and 128MB of DDR2 RAM

USB Host

Micro SD slot

Linkit Smart 7688There is a breakout board for this and as you can see it does have a proper Ethernet connector.  There are also a host of other add-ons but I’ll leave you to go off to SEEED’s website if you’re interested in more.

http://www.seeed.cc/linkit_smart_7688/

The unit runs OpenWrt Linux (I’ve not tried expanding it with the MicroSD card underneath so I’m just using it right now as it comes out of the box). You can program in Python, Node.JS (which is why I’m interested) and C.

Rather than me rant about other features and the video etc… here’s the link. http://www.seeedstudio.com/depot/LinkIt-Smart-7688-p-2573.html

And yes, it has NPM!

The next model up (7688 DUO) has an MCU and can be programmed in C  using the Arduino setup – so there is something here for both beginners and advanced programmers.

Facebooktwittergoogle_pluspinterestlinkedin

A successful Techy Day

So much going on today I thought I’d put the lot into one blog entry.

So, I’ve spent the day with my pal playing with one of several IOT solutions – familiar to regular readers – node-red-contrib-ui. This just keeps getting better.

tmp6D4ASo we spent our afternoon getting to grips with the new “template” node which Andrei the designer has been improving recently. We wanted an RGB controller which the UI does not (did not) currently feature. Getting to grips with Angular and how it interfaces with the UI is proving a challenge but the long and short of it is (I know a couple of you are about to get excited) – we have a working RGB controller.

Here it is. Just ignore my FREDDY experiments and the pretty coloured line of buttons…

Well, no, don’t ignore the buttons – I’m finding increasingly frustrating to have to use the big but still limited range of ANGULAR icons – so I’m about to write off to Andrei to see if we can maybe trap HTTP in the icon description to allow us to use any arbitrary online PNG file – preferably transparent ones – imagine you have a row of buttons for +, minus and auto.  The Angular icons do + and -  but how on earth do you represent “AUTO” – I could think of a 1000 examples where you just can’t do it with a limited set of icons… so that needs work…

Update 31/12/2015 – It is now my understanding that soon we will have the ability to use our own images as well as an expanded library – that is just excellent!!!

However I digress – see the bottom line – RED GREEN AND BLUE controllers (ignore the yellow, I’m experimenting). On the right is a BLACK BLOCK which changes colour as you move the sliders. So this TEMPLATE node in Node-Red UI- and this is all down to Andrei, has an input and an output – the output puts out  JSON string with R G B values…. the input expects msg.payload.r, msg.payload.g etc… well I didn’t have a CLUE how to do that so again Andrei helped. So here I will show you an example of use –, the template node and the input to manually set the controls. I CAN CONFIRM that all of this mirrors perfectly if for example you have this running on 2 phones at once – they remain in sync perfectly!!!!  This is just so good!

tmp7074

So above you see an inject (ignore the timestamp) – the function will set up 3 values to put into the template to affect the sliders – so for example you can set up initial conditions.

msg.payload = {
  r: 10,
  g: 50,
  b: 100
};

msg.payload.b=190;
return msg;

So there’s an incoming payload which we’re going to ignore – the bit I was not sure about was adding new stuff – ie msg.payload.r  and again Andrei came to the rescue – you’ll see I’ve initialised RGB values and then proven to myself that you can quickly alter them before sending MSG off to the template node. The output of the template node goes off in this case to a DEBUG node and there’s a JSON string with RGB values going out (that might be used to populate a global variable and off via MQTT to some RGB lighting).

Here is the content of the template.

<div layout="row" layout-align="space-between center">
    <md-slider ng-model="msg.payload.r" ng-change="send(msg)" flex="30" min="0" max="255" class="slider-red">
    </md-slider>
    <md-slider ng-model="msg.payload.g" ng-change="send(msg)" flex="30" min="0" max="255" class="slider-green">
    </md-slider>
    <md-slider ng-model="msg.payload.b" ng-change="send(msg)" flex="30" min="0" max="255" class="slider-blue">
    </md-slider>
    <div style="width: 32px; height: 32px;" ng-style="{'background-color': ('rgb(%d, %d, %d)'|sprintf:msg.payload.r:msg.payload.g:msg.payload.b)}">
    </div>
</div>

<script>
(function(scope) {
    scope.$watch('msg.payload', function (v) {
        if (!v) scope.msg ={ payload: {r:0, g:0, b:0} };
    });
})(scope);
</script>

<style>
    .slider-green .md-track-fill {
        background-color: green !important;
    }
    .slider-green .md-thumb:after {
        background-color: green !important;
        border-color: green !important;
    }
    .slider-blue .md-track-fill {
        background-color: blue !important;
    }
    .slider-blue .md-thumb:after {
        background-color: blue !important;
        border-color: blue !important;
    }
</style>

What you have there is not only the RGB controls – but all you need to know in order to make any custom system you like which has INPUTS and OUTPUTS. This is so very useful.

So there you go – a great new UI gadget.

Strangely enough – I needed that bit of knowledge about adding stuff to MSG as today another pal of mine pointed me to an ANDROID/IOS App called OWNTRACKS. It has a lot of uses but one of it’s features allows you to set up your phone to send regular LONGITUDE/LATITUDE messages to your own MQTT server.

Now, I went off on a crawl and found a NODE-RED node to do GEOFENCING – here it is.

tmp6FBE

So the ORANGE node is a node called GEOFENCE (node-red-contrib-geofence).  This is marvellous – so you feed it longitude and latitude and it compares against a set area and either passes the message through – or not.

On the left you see my MQTT node picking up a topic which I set on the phone. Next you see me convert the data to the right vars – exactly the same issue I had above so I killed 2 birds with one stone – here’s the function.

var fred=JSON.parse(msg.payload);

msg.location = {
  lon: 0,
  lat: 50
};

msg.location.lon=fred.lon;
msg.location.lat=fred.lat;
return msg;

So from my incoming MQTT in a format decided by the App, not me I’ve created 2 items which the geofence node understands – regular updates as to where I am.

Here’s the winner – the Geofence admin page when you click on the orange Geofence node.

tmp2B7F

This is so good I’m betting I don’t have to explain how it works – you simply put a square, circle or shape around a location, town, house or whatever – and if the incoming coordinates are in that area the whole message just gets passed through – if not, nothing gets passed through. There are other options!!

The obvious next move is a function with a check to ensure you were OUT of the area and coming IN and the string “I’m nearly home, get the kettle on” – passed to the speech system I showed you in my last blog. In my case I’d likely get beaten up for doing that but I’m sure you understand the MASSIVE potential for this.

Put welcome lights on when coming home, alarm the house when leaving etc etc etc… actually with an ESP8266 you could put the kettle on yourself!!! HEY that’s a good idea.

All of this takes only minutes to get going when you have info like this (I had to kind of fumble through much of it). You could use multiple nodes from the same MQTT input to do all sorts of analysis on movement. What’s needed next it really tmpFED7cheap GPS transmitters for the cats!! Just so many possibilities.

So – that was that – then when I got home tonight – the post was waiting for me.  This little number arrived in the post.. This bare board was less than £2 on Ebay… http://www.ebay.co.uk/itm/172017546015?_trksid=p2057872.m2749.l2649&var=470889509954&ssPageName=STRK%3AMEBIDX%3AIT

Ok, it needs 2 MOSFETS, a couple of resistors (SMT) and a regulator and an ESP-12 and you have yourself a handy 0.1” centres development board – only for true soldering iron enthusiasts but I thought it would be worth having.

tmpD4F5As well as that, SEED STUDIOS sent me their LinkIT SMART 7699 board and a nice adaptor to go with it… I’ll have to write this up later when I get enough time to do it justice but on the left you see one of the little boards – it has 2 micro-USB sockets – 3 buttons (reset, program, user) and a WIFI module with lots of IO – the accompanying breakout board lets you do the whole thing with wires and connectors without going anywhere near a soldering iron.

Unlike ESPs (which are of course cheaper) these little devils run Linux!! Anyway, it’s late but here’s a link for interested parties.. http://labs.mediatek.com/site/global/developer_tools/mediatek_linkit_smart_7688/whatis_7688/index.gsp

 

And that is about it for one day. I’ve just found a cheap TIMER unit for my upstairs radiators so I can turn them off when we’re sleeping downstairs and by the time that turns up I’ll have a very pretty mobile application for my good lady to control the heating with.

Good night, all.

Facebooktwittergoogle_pluspinterestlinkedin