Neopixels, ESP8266, NodeMCU and Arduino IDE

Hello everyone!

Another update on the ESP8266!

Recently, an Arduino compatible IDE was released for the ESP and I’m super keen to try it out. I’ll download it later today and give it a go, ideally I want the adafruit neopixel library to work as then I can connect my coaster to the internet!
More on that in a minute.

Yesterday two things arrived in the post, my 16 neopixel ring, and my NodeMCU dev board.

image

Both very exciting!
Maybe I can combine the two? 😉

image

The dev board is because ive had difficulty flashing the ESP chips in the past so I was hoping to have better luck with a breakout board with inbuilt USB TTL and a flash button. I did! It flashed the latest NodeMCU firmware right away!

image

Node MCU is an alternate firmware for the ESP that has a runtime for Lua 5.1.4 inbuilt! So this is the excuse I’ve needed to learn a bit of lua!

image

I’ll also be using this later with the Arduino IDE and I’ll make up an image for cross referencing pins.

The neopixel ring is to be used in my ongoing quest for the most amazing coaster ever.

It will make my drink disco!

I’ve had a prototype in the past using a single RGB LED, then another using a disc of them, and this one is a ring, but they’re addressable!

What I’m hoping to get is a sort of rainbow flowing effect happening.

Ive got the code at a good starting point, for effect testing.
All I did was modify the example sketch that goes through a bunch of possible modes 😀

I’m driving it from a digispark board, and in the final build it will use a 3.7v lipo for power.

image

The LED ring does seem extremely bright, and gets a little hot during normal operation so I better look at dimming the LEDs as I only need enough light to light up my drink! Not the room Hahaha

There’s a few different sized ones too. The one with 16 and the one with 60 LEDs cost the same! D: sadly I don’t need that many though it’s far too big for my purpose hahaa

Maybe I can find a use for 60… Hehehhhh..
Oh and they come in strips too and individual of course! And boards… THERES LOTS OF CHOICES OK?

Anyway,

That’s all for now, I’ll keep y’all posted!

Bonus: it sticks to the wall of the train lol

Baofeng headset adapter

Not being content with the painful to wear headset my friend received with their baofeng uv-5r radio, they asked me to make an adapter to use regular headphones with it.

I went one step further for them and included support for headphones with microphone, and PTT button.

This is the working prototype, have to tidy it up a little, and mount things nicely in a box.

It break out to two 3.5mm sockets, one for speakers and one for mic. From there I’m using a spare adapter I had that turns the two separate sockets into a single 4-pole socket!

This let’s you use 4-pole earphones with mic

The volume is crazy loud at the moment so I’ll have to add in a resistor. And nothing is soldered yet, just twisted in, Hehe. I’m in a train (y)

Anyway, I can’t test the mic yet, but the PTT button does work. Not sure where it would be most convenient yet

I’ll figure something out. For now enjoy these images :

image

SRC: http://r4f.su/transivers/baofeng_bf-888s/kenwood_ham_pinout.gif

image

image

image

Cool Tool.bat

I made a batch script at work today to automate a few things as I was working on 15 PCs at once…

Thoguht I would share it here in case someone who happens to be in the same situation stumbles on it!

It has a number of features for example changing the PC name, changing the key for MS Office and then activating it, activating the local admin account and setting a password, auto logging a user in, and REBOOT =D

Its probably buggy, but worked 13 times out of 15 for me! so deal with it..

oh, install office doesnt work but meh. 😀

here she be:

 

@echo OFF
TITLE Cool Tool
color f0
:MENU
CLS
ECHO ============= COOLTOOL =============
ECHO ————————————-
ECHO 0. Install Office
ECHO 1. Activate Local Admin (Blank Password)
ECHO 2. Rename PC
ECHO 3. Auto Login “Administrator”
ECHO 4. Install office key and activate. (WARNING: INSTALL OFFICE x64 FIRST + CONNECT TO NET)
ECHO 5. Reboot PC To apply changes.
ECHO ==========PRESS ‘Q’ TO QUIT==========
ECHO.

SET INPUT=
SET /P INPUT=Please select a number:

IF /I ‘%INPUT%’==’0’ GOTO OFFICE
IF /I ‘%INPUT%’==’1’ GOTO ADMIN
IF /I ‘%INPUT%’==’2’ GOTO RENAME
IF /I ‘%INPUT%’==’3’ GOTO LOGIN
IF /I ‘%INPUT%’==’4’ GOTO OFFICEKEY
IF /I ‘%INPUT%’==’5’ GOTO REBOOT
IF /I ‘%INPUT%’==’Q’ GOTO Quit

:OFFICE
office\setup.exe

GOTO MENU

:LOGIN
echo 1st run.
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
echo 2nd run..
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
echo 3rd run…
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
echo 4th run….
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
done. =D
GOTO MENU

:RENAME
SET INPUT=
SET /P INPUT=Input Computer Number:

echo PCs new name will be: %INPUT%
pause
wmic path win32_computersystem where “Name=’%computername%'” CALL rename name=’%INPUT%’

GOTO MENU

:ADMIN
net user administrator /active:yes
net user administrator “Password”

GOTO MENU

:OFFICEKEY
cd “C:\Program Files\Microsoft Office\Office14\”
delay 3
cscript ospp.vbs /inpkey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
echo I SET THE KEY FOR YA. Now to activate…
cscript ospp.vbs /act
echo DONE!

 

By the way,

The auto login runs a bunch of times because sometimes it works but doesnt…work..?
😀

The eero Wireless thing

eero10

Just a little post to voice my opinion about the eero wireless device that surfaced overnight,

From what I have read about this device, it is a mesh networking device that is simple to use down to the point of needing almost no user interaction.

In fact, I believe they are claiming that after the initial setup there is no specific need for human interaction at all, it should take care of itself, including rebooting if the DSL/net drops out (straya m8) |

My first impression is that it looks like a poor mans Cisco Meraki,
which is what I use at home (one station, MR18)

I do feel they are going to have a hard time becoming popular though as they are asking a lot of money for them!
For the discounted pre-order price of the eero ($125 each or three for $299) you can already get a high end wireless router, and probably even a decent wireless repeater on top of that considering you would probably want more than one to take full advantage of the purpose of the device!

 

I would also like to note im a bit sceptical about its claim to be able to fix WiFi problems automatically, what if the DSL drops out?

It cant reset the DSL modem ?
The eero itself is just a router..

 

but oh well, I haven’t actually used the device.

I may send them an email about getting a unit to loan out and review properly.

Mini Raspberry Pi Rant

I’m just making this post to vent out my anger,

In my personal experience, the Raspberry Pi is THE SINGLE MOST UNRELIABLE DEVICE I HAVE EVER OWNED.

I have had two raspberry pis, neither of them show better results.

For me, every time I power on my Pi its a matter of praying to the gods that it turns on.

I have tried all range of SD cards, from $100 sandisk extreme cards to $2 chinese cards to the official one itself!

It seems that almost every second time I turn the damn thing on, I am met with the god damned faintly lit green LED that means theres no OS detected.

GOD DAMNIT THIS THINGS USELESS

I always shut down with ‘sudo shutdown -h now’

BUT THIS SAME THING HAPPENS STILL

IS IT TOO MUCH TO ASK FOR IT TO JUST WORK CONSISTENTLY ?!

WHY DOES IT CORRUPT? WHAT AM I DOING WRONG???

WHY DO PEOPLE STILL USE THIS POS!?

Welp, time to spend another few hours setting everything up from scratch again or trying to repair the filesystem.

 

EasyIoT DS18B20 Temperature Sensor – ESP8266

I needed a temperature node, but I didn’t have a DHT22 temp/humidity sensor!?

So I modified the example sketch for the DHT to use a DS18B20 Digital Temperature Sensor instead!

It works great!

The sensor is connected as shown here:

http://www.hobbytronics.co.uk/ds18b20-arduino

Heres the code:

 

/*

DS18B20 Digital Sensor Node Sketch for EasyIoT Server
Modified by Lewys Martin <[email protected]>
See: blog.lewys.eu for details

Original Code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

V1.0 – first version

Created by Igor Jarc <[email protected]>
See http://iot-playground.com for details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
#include <Esp8266EasyIoT.h>
#include <SoftwareSerial.h>
#include <DallasTemperature.h>
#include <OneWire.h>

#define CHILD_ID_TEMP 1
#define SENSOR_DIGITAL_PIN 2
Esp8266EasyIoT esp;

SoftwareSerial serialEsp(10, 11);

OneWire oneWire(SENSOR_DIGITAL_PIN);
DallasTemperature sensors(&oneWire);

float lastTemp;

Esp8266EasyIoTMsg msgTemp(CHILD_ID_TEMP, V_TEMP);
void setup()
{
serialEsp.begin(9600);
Serial.begin(115200);

Serial.println(“EasyIoTEsp init”);
esp.begin(NULL, 3, &serialEsp, &Serial);
//esp.begin(NULL, &serialEsp);
esp.present(CHILD_ID_TEMP, S_TEMP);

sensors.begin();
}

void loop()
{
while(!esp.process());

sensors.requestTemperatures();
float temperature = (sensors.getTempCByIndex(0));
if (isnan(temperature)) {
Serial.println(“Failed reading temperature from sensor”);
}
else if (temperature != lastTemp)
{
lastTemp = temperature;
esp.send(msgTemp.set(temperature, 1));
Serial.print(“T: “);
Serial.println(temperature);
}
}

And some pictures:
image

image

ESP ARDUINO PERFBOARD THING

I actually managed to produce something that is NEAT

and well laid out (in my opinion)

Parts:

• Arduino Nano
• ESP-01
• 5-3v Level Shifter
•  Perfboard
• Bunch of headers
• Some wire
• Soldering Iron + 0.3mm Solder
• Dremel to clean things and cut things and stuff

 

As you can see in the photos:

The board as a whole:

Whole Board

The board with components removed:

Components Gone

The underside of the board:

Underside

Cleaned edges with Dremel:

(i got a Dremel for christmas btw)
(i got a Dremel for christmas btw)

The things I have to add still:

Also, as you can see, theres a notch missing from the Arduino near the ICSP pins, I used my Dremel to grind that away (theres no traces there as far as i can tell) so that the ESP module fits so perfectly there and the whole package fits inside the dimensions of the perf board 😀

Arduino pin 2 for DHT22, 13 for relay.
Arduino pin 2 for DHT22, 13 for relay.

This node has been added to my EasyIoT Server as a secondary relay node for the time being, but I want to get my hands on a DHT22 to add a temp/humidity sensor to my bedroom 😀

Then I can start expanding to other rooms in the house! MWAHAHAA

MY BEDROOM LIGHT IS NOW CONNECTED TO WIFI

Using a full size Arduino Uno modified to 3.3v, and that weird shield I built, modified to software serial pins 10 and 11, and also to add a power input of 5v that gets regulated to 3.3v on both the shield for the ESP8266, and the arduino for… itself?

It connects to a Raspberry Pi running the latest version of Raspbian and EasyIoT Server, I figured out their API without even a mention of there BEING ONE ON THEIR WEBSITE (they don’t mention it anywhere but i noticed a mention of it in the console log and figured it out)

The ESP8266 01 type connects to the main WiFi, then to the server, from then I can browse to the IP of the server and theres a beautiful interface 😀

The EasyIoT server also supports the RasPi GPIO and the MySensors stuff, so Im gonna use that for things like doors, and temp/humidity sensors

Photos will come soonish:

image

image

image

image

image