Booting ESXi on a Dell R720 from an NVMe Drive

I found a nifty trick with ESXi.
If you want to use an NVMe Drive as your main datastore, you can install to it as normal, but the Dell R720 will not boot to it. (at least in my case, using a Kingston A2000 NVMe SSD on an Orico PCIe Adapter card)

The UEFI simply doesnt see it as a drive.

But what you can do is create a 4GB HDD partition on the vFlash SD card, and install ESXi to that.



While smaller than the minimum disk size of 8GB, the installer will run correctly.

You can then reboot the system, and boot off the 4GB vFlash partition.

Somehow ESXi seems to realise what’s going on and switches over to the NVMe drive!

When it boots up, you will find that your datastore resides on the NVMe drive.

Lasercut Server Rack Blanking Panels

To my surprise, I cannot find any sort of blanking panel template for laser cutting on the internet. Considering how common laser cutters are becoming, I expected to find at least some… oh well, I have made my own and will share it with you here!

I threw this together in Illustrator and share with you three files, an AI, an SVG and a DXF for cutting or whatever you want.

Enjoy:

1U and 2U Blanking Panels DXF

Edit: cut and tested some they fit well 🙂

Updating my last Arduino based ESP to ESPHome

I have most of my ESP based IoT devices running ESPHome by now, but there was one left that I hadn’t spent the time figuring out how to adapt.

That was the one that lives inside my wall, and opens the buildings door by shorting two contacts on the intercom system.

My requirements for this were backwards compatibility so that my scripts and automations that were setup to control the door via MQTT could still function, this way I can continue to operate as normal but with the addition of OTA updates and telemetry from the node thats hardest to reach!

The original code involved subscribing to a topic, and waiting for a payload, then turning the relay on and then off again, for a momentary press.

#include <ESP8266WiFi.h>
#include <PubSubClient.h>

#define CLIENT_ID "buildingdoor-singlerelay"

#define RELAY_PIN 0


// Update these with values suitable for your network.
const char* ssid = "WiFiSSID";
const char* password = "WiFiPassword";
const char* mqtt_server = "MQTTServerIP";

WiFiClient espClient;
PubSubClient client(espClient);
long lastMsg = 0;

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(RELAY_PIN, OUTPUT);
  Serial.begin(115200);
  setup_wifi(); 
  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);
  digitalWrite(RELAY_PIN, HIGH);
  pinMode(D3, OUTPUT);
  pinMode(D1, OUTPUT);
  digitalWrite(D1, LOW);
}

void setup_wifi() {
  delay(10);
  // We start by connecting to a WiFi network
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid); //We don't want the ESP to act as an AP
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) 
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();

  // Switch on the LED if an 1 was received as first character
  if ((char)payload[0] == '1') {
    client.publish("building/door/relay", "1");
    delay(100);
    digitalWrite(RELAY_PIN, LOW);
    delay(200);
    digitalWrite(RELAY_PIN, HIGH);
  }  } else {
    digitalWrite(RELAY_PIN, HIGH);
    delay(100);
    client.publish("building/door/relay", "0");
  }

}

void reconnect() {
  // Loop until we're reconnected
  digitalWrite(LED_BUILTIN, LOW);
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect(CLIENT_ID)) {
      Serial.println("connected");
      client.subscribe("building/door/relay/set");
      digitalWrite(LED_BUILTIN, HIGH);
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
  }
}

void loop()
{
  if (!client.connected()) {
    reconnect();
  }
  client.loop();
}

The new ESPHome code, does this, in addition to supporting the Home Assistant API and reporting back some values such as the WiFi Signal Strength!

esphome:
  name: buildingdoor
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: 'WiFiSSID'
  password: 'WiFiPassword'
  domain: .local
  fast_connect: true
  manual_ip:
    static_ip: 172.16.0.XX
    gateway: 172.16.0.1
    subnet: 255.255.255.0
mqtt:
  broker: 172.16.0.XX
  username: MQTTUsername
#  password: MyMQTTPassword
  on_message:
    topic: building/door/relay/set
    then:
      - switch.turn_on: building_door_switch
api:

# Enable logging
logger:

ota:

switch:
  - platform: gpio
    pin:
      number: 0
      inverted: yes
    icon: "mdi:office-building"
    name: "Building Door Open Switch"
    id: building_door_switch
    retain: false
    discovery: false
    availability:
      topic: building/door/status
      payload_available: online
      payload_not_available: offline
    state_topic: building/door/relay
    command_topic: building/door/relay/set
    on_turn_on:
    - logger.log: "Building Door Relay Activated!"
    - delay: 0.2s
    - switch.turn_off: building_door_switch
    on_turn_off:
    - logger.log: "Building Door Relay Deactivated!"

sensor:
  - platform: wifi_signal
    name: "Building Door WiFi Signal"
    update_interval: 60s
text_sensor:
  - platform: wifi_info
    ip_address:
      name: Building Door ESP IP Address
    ssid:
      name: Building Door ESP Connected SSID
    bssid:
      name: Building Door ESP Connected BSSID

I first connected it externally next to the wall, and listened to hear that they indeed, both fired when they were supposed to, and once confirmed, I opened up the wall, switched out the ESP-01S modules and closed it all back up!

Vivid 2018 LED IoT Apparel !

Hello! 

Continuing with the tradition of creating something beautiful and covered in LED lights, this year we have something special!

Previously, we had the LED Jacket with Tearschu, and the LED Dress with Naifel. Taking inspiration from these, and solving a lot of the problems I faced with them, I bring the latest iteration of light up fun.

This year, I have taken a pair of high heel boots, and an umbrella from Daiso, added plenty of pretty lights, and of course, this year marks the first year the entire project is connected to the internet.

 

 

The project was built using mostly the same core components for each item. 

The shoes each have:

  • Lithium Ion Battery (1000mAh)
  • LiIon Charge / Boost circuit MP2636 
  • WeMos D1 Mini
  • A random switch for power
  • A strip of WS2812 LEDs

The umbrella is similar, except instead of the MP2636 boost circuit and 3.7v Lithium battery, I used a 3s LiPo battery, and a 5v step down regulator capable of high current.

 

The physical build was pretty straight forward, hook up everything how you please, battery to boost/charge, from there to the WeMos / LEDs, and then route the wires how you please. For LED placement on the shoes, I went with up along the front as I feel this will look the best having the light cover the most area, and for the umbrella I ran the lights down the spokes of the umbrella.

Unfortunately with my design you cant really CLOSE the umbrella anymore but as this is just for Vivid I am not too fussed 🙂 

To attach the LEDs to the umbrella I initially tried to use hot glue, but it was actually melting through the umbrella, and the parts that didn’t, did not hold very well, so I ended up using clear packing tape, as it does not seem to get in the way of anything and is barely noticeable! 

The LEDs here are hooked up in parallel with each other, so each spoke on the umbrella will be the same.

This slideshow requires JavaScript.

Once it is all made up physically, we can move on to the code.

I was looking into using the McLighting project for control of these, as it has both an internal web interface as well as support for things like MQTT, but I could not get it to work reliably, and it didn’t support running in AP mode, only client mode, which was a big turn off for me.

So what I ended up using was the JSON LED code from BRUH Automation, because I use this for other things at home and it works pretty reliably.

One thing to note here, for my LEDs I had to add the following two lines of code, BEFORE including the libraries, to prevent flickering of the strip. (not sure why this works?)

#define FASTLED_INTERRUPT_RETRY_COUNT 0
#define FASTLED_ALLOW_INTERRUPTS 0

 

(at the verryy top of the sketch)

 

Now my initial plan included taking a small portable router, and a Raspberry Pi 3 out with me to vivid, running a local MQTT server on a local network, with the Pi running Home Assistant (Hass.IO) all locally so I could connect to it to control things. However I ran into many problems attempting to do this, I am not sure if its because I don’t know how to properly setup static IP’s in resin, or just because it hates me, but I kept not being able to connect or it wouldn’t respond to my commands, it just wasn’t working great.

 

One day though, my good friend Mark came over and we needed a project to work on, so what we set up was a private mosquitto MQTT broker, that requires authentication, running in Docker on a Ubuntu Server 18.04 LTS install!

What this meant,  was I now had a secure way of connecting a remote node to my Home Assistant running back home.

 

I went right ahead and adjusted the code on the three items for the new server, forwarded the ports in my router, added the config to my production Home Assistant server, and hey presto, was I glad to see, everything JUST WORKED.

 

I made a view in Home Assistant and threw all the entities into it, and here’s how that looks:

So as you can see, we can control both shoes together, each individually, the umbrella on its own, or everything as a group!

We also can change the animation speed of the various effects.

I will be heading out to vivid to shoot a small video and some photos with this, with my good friend Tsugumi modelling it for me, on the 9th of June 2018 from about 6PM onward, Not sure if I will be at Circular Quay or Darling Harbor yet, keep your eye on my Instagram to find out! 😉 

 

Thanks for reading!!!

Getting a Fargo DTC550 ID Card Printer working

Armed with nothing but the printer and a small handful of blank cards, I set out to get this machine back into working order, and find some way of printing my own access cards with it.

This will be a quick post, mostly for my own reference in the future, so lets get right down to it.

 

The first hurdle was the power supply, the printer is rated at 24v 3.3A ‘max’ the max part leads me to think I can get away with less, considering that I have some 24v 2A power supplies laying around, I attempted with that. I spliced a DC barrel onto one and hooked her up (Center positive) Good news! It powers up fine, 

I poked around the menu a bit and accidentally printed a grey test image onto the last… card? in the machine, its more of a sticker shaped like a card but hey, it printed fine.

Printed a color one next onto a plain white PVC card I had, all went well ! Colours looked good, so I figured it’s time to hook it up to the PC and see what I can find.

Windows installed some kind of generic driver for it, but it didn’t have any information, and I couldn’t access it from any application. So I hit up Google and.. well it’s damn hard to find ANYTHING on this machine.

I know its pretty old but damn, is a driver too much to ask for? 

Even the HID website, that replaced the Fargo website, has a link to the driver, that gives a 404 error !

 

Luckily after searching for a few hours I found a janky ass website that had a zip file with a random string as its file name… being pretty desperate at this point I downloaded it and looked inside, it looked pretty legit.. a couple of ini files, some infs and an exe with a convincing icon…. 

Heading back to device manager I did an ‘Update Driver’ and pointed it to the newly extracted folder to search, and to my amazement, it found a better driver and installed it!

 

The printer now installed itself as a regular system printer, which was great, because it took away the need to find some special software that supported the printer. You can print from anything, MS Paint to Lightroom, Windows Photo Viewer to Photoshop!

Just remember to make sure the images have CYMK colour pallet… 

 

I did find though, that most programs leave a tiny border around the outside, its only a fraction of a millimeter but it’s noticeable. 

The software I am using though, is from HID, called Fargo Workbench.

 

I will attach the two items referenced in this post so that I or anyone else can get them in the future. I’ll rename the driver to something more human friendly too!

 

 

Click Here to download Fargo DTC550 Driver

Click Here to download Fargo Workbench Software

Programming my Gherkin

Over the weekend at the Sydney Mechanical Keyboard Meetup, I got my hands on some DSA keycaps, The intent is for them to replace my dodgy sticker based ones on the Neutrino, but for now I decided to put them on the Gherkin to see how I fair with it having DSA keycaps on it! 

 

I forgot the keymap I had programmed so it is easier to just remake a new keymap imho.

 

Ill document it all here for future reference to stop myself forgetting next time 🙂

 

 

So as usual, we will use http://kbfirmware.com  

 

Now if you havent seen the gherkin its a 30%? 40%? keyboard, that has a 10*3 matrix on it.

 

More info here: http://www.40percent.club/2016/11/gherkin.html

 

Now we’re pretty lucky, on this page we have links to a json file for the firmware builder ! Lets use this!

 

 

The wiring is pretty funky if you ask me, its  very confusing. So i’ll just assume that it’s correct..

 

 

Now mine has LEDs so for those, Ill connect pin D3 on the header to the DIN on the WS2812 strip.

 

Using the handy pictures over here we can see the pinout of that header.

I have 11 LEDs so we will set that in the firmware builder and set it to D3 pin, Don’t forget to disable the other LEDs we aren’t using such as caps lock and num lock.

So ive messed with the layout and happy with this I think for now:

 

Now that I have configured everything, I have a custom json file

 

Lets download the hex file and flash it !

 

and we have success !

 

Everything works as intended 🙂

Thanks for reading !

 

edit: I changed some keys and added an esc key on layer 1 of N key thats all

Why I play around with Home Automation

Hello, I’m posting this just before bed to clear something up. Apologies if things don’t make sense.

When people find out about my smart home setup, the most common thing I get from people next to “was it expensive” is “you’re really lazy”

Its not about the effort I save by not getting up to flick a light switch.

For me, this is my hobby. I take great joy in setting up different systems to work and play together nicely, for example, most of the sensors in my apartment are on a ZigBee network, while most of the lights are WiFi, even the different brands of bulbs, and then there’s a few Z-Wave devices in the mix.

I go to a lot of trouble and effort to set these things up, to maintain them, its very time and effort consuming.

I am learning HEAPS as I go along, about how things work, how different technologies work together, improving my understanding of code and syntax and even learning new languages.

Theres a huge level of satisfaction I get when something I’ve spend hours, even days working towards, finally works.

Such as the other day when I was at work, not even thinking about the weather outside, and I got a Facebook message telling me the temperature in my bedroom had exceeded 27°c.

This reminded me I could set the thermostat to 23°c befoee I left work, so that when I got home my room was nice and cool.

Or when I walk into the kitchen and the light turns itself on when I enter, turning itself back off when I leave again.

Even simple things like all the lights turn themselves off at 1am in case we have fallen asleep and left them on.

Its all these end results that I work hard to achieve.

The feeling of moving aroundy normal life, and having these things just happen when they need to, makes me feel more free, if I want to watch a movie, I select it on my phone, the tv turns on and starts playing the movie, the lights dim while its playinf, then when it’s finished, the tv turns off and the lights come back up, is amazing, it feels so natural, things happening when I need them, not just when I do them.

So next time you hear that I’ve set up my light to be voice controlled, instead of thinking “that’s so lazy” think more about how it can be helpful, like “wow of your hands are full you can still turn on the lights” or even “wow if you’re tired and don’t want to get out of bed, you can turn them off from there!”

This post isn’t targeted, I’m just attempting to convey my point of view.

If it was a matter of being lazy, I wouldn’t go to the copious amounts of effort that I do in order to setup this stuff.

Setting up RTL-SDR in 2017

Years back I discovered RTL-SDR, that used very cheap USB TV tuners to run Software Defined Radio applications.

Back then I found it super easy to setup,

 

You just download ‘SDR#’ and run the installer, then you’re good to go!

More recently though, AirSpy selling their own SDR products, I recall having more difficulty setting it all up..

 

So let’s give it a shot here today.

Heading over to the AirSpy downloads page

I downloaded the ‘Windows SDR Software Package’ which seems to be similar to the old version, containing SDR#, ADSB Spy etc.
This downloaded a familiar looking sdrsharp-x86.zip file

Extracting this zip gives a familiar folder structure, with an install-rtlsdr.bat file, perhaps it hasn’t changed much after all? Not sure why I seemed to have so much problems last time…
I fired up Zadig as admin after it had downloaded and selected Options > List All Devices so that I could find my RTL device.

And with that its time to launch SDRSharp.exe !

The first thing ill do is pop into the options gear up the top there and change the device to RTL-SDR (USB). Then back into options and ensure the correct device is selected and the RG Gain is turned up a little.

And with that, we’re in!

It all seems to be working fine. I did a frequency correction of 3ppm and got it centered on a carrier wave.
Im now able to use this to identify which frequencies are in use around 500mhz so that I can fix up some wireless microphones that are complaining about interference!

 

It was much easier than last time. Not sure why I had so much trouble….

Powering 12v LED Strips with batteries

Over the years, I have used many types of LEDs, but the most commonly used and cheapest, is standard 5050 LED strip. It comes in a variety of colours, and RGB multicolour.

However the cheap strips, as in, $15 for 5m, always run on 12v.

I have in the past used a number of different methods, starting off with a 9v battery, then a pack of AA cells, at one point I even carried around small SLA cells! (heavy omg)

More recently, I have been using 3s lipo packs, however these can be dangerous if damaged, and require a special charger to charge up.

I normally use a Turnigy Nanotech 3S 1.6Ah battery, I have a few of these laying around that I keep at storage voltage.

The problem with Lithium batteries is that, while they are usually stable, when they do become unstable, they go out very violently.

See these:

 

I have recently been contacted by a group of cosplayers that want to add LEDs to their Hyperdimension Neptunia cosplays, and were wondering how to power the LEDs, so im going to revisit this as there must be a better way.

 

When I added lights to my friends Ahri tails, we used my nanotech batteries the first round, but more recently, her friend made her a pack that takes three 18650 cells,

this is certainly easier for her to charge, and swap out the batteries, but I felt it and it was pretty warm, so kinda scary, to be fair though, her tails have almost 10m of LEDs in them, so it’s probably drawing some 6-10ish amps from those poor 18650s continuously.

 

Another option is to use 5v LED strips, i’ve got a meter of this and tested it, and its just not as bright … its probably the best option as of typing this though as power banks can be purchased cheap in sydney (~$12 for 4000mah one from a reputable shop)

There are alternatives worth looking into, such as a custom 18650 case, or this thing over here

The other things that are available are these:

I have used these in the past, but knowing what I do now about Lithium, I wouldn’t touch these with a 10 foot pole. There may be no protection inside, they may not be balance charged, and they probably don’t even have voltage cutoffs… very dangerous and scary..

 

 

As it stands, I still recommend to go with a 3S Lipo pack.

 

You will need a few things:

 

  1. Battery – 3 cell Lithium Polimer, capacity of your choice
  2. Low Battery Alarm – Tells you when the battery is flat
  3. Balance Charger – Important to prevent boom
  4. Flameproof bag – Important to store the batteries
  5. Power supply for charger – Your LED Strip MAY come with one that works (12v 2A+)

Here are the ones I recommend:

 

Battery:

https://hobbyking.com/en_us/turnigy-nano-tech-1800mah-3s-25-50c-lipo-pack.html ~$20

Low Battery Alarm:

https://hobbyking.com/en_us/hobby-king-battery-monitor-3s.html ~$5

Charger:

https://hobbyking.com/en_us/hobbykingr-dc-4s-balance-charger-cell-checker-30w-2s-4s.html ~$12

Flameproof bag:

https://hobbyking.com/en_us/fire-retardant-lipo-battery-bag-250x330mm.html ~$5

Power Supply:

http://www.ebay.com.au/itm/112219709452 ~$10

Please take good care not to damage the Lithium batteries, if they feel warm, turn it off for a bit and let them cool down.

 

To connect the LED strip, you will need a XT60 connector to solder onto it, these are ~$8 for a 5 pack.

https://hobbyking.com/en_us/xt60-male-w-12awg-silicon-wire-10cm-5pcs-bag.html

Feel free to contact me with any questions and I will do my best to answer.

 

Part 2: Which LEDs do I get?

 

There is different types of LEDs, Ive briefly mentioned them above, the main ones are: single colour, RGB multi colour and these come in both 12v and 5v.

 

For the above power solution that I recommended, you want 12v leds.
Which ones you get depends on your needs.
Some colours are available as is, and if the colour you want is available standalone, I suggest this as it will be less messing around. So if you need pink LEDs, and you find pink LEDs as well as RGB ?? Go with the pink ones.

If you need a colour you cant find, or want to be able to change, go with the RGB.

They also come in two sizes, if RGB, please try to always get 5050 LEDs, and avoid the smaller 3528 where you can. as each light can only be one colour, so for the RGB, you have a red light, a green light and a blue light every 3 lights. It results in a weird christmas light effect that looks terrible:

With 5050 RGB LEDs, each light has three tiny lights inside, so each actual light on the strip will be the colour you want.

For controlling them, if its single colour, you just need to give it power. If its RGB, most will come with an InfraRed (IR) controller, which is probably good enough, but there is also wifi and bluetooth controllers available.

You also want to check how many LEDs per meter there are. Most strips will come with 300 LEDs but some come with 150, this results in the lights being very far apart from each other and it doesnt look nice. so make sure its at least 300 LEDs.

 

To get really fancy, you can get what are known as addressable LEDs, but this is pretty advanced and needs a tiny $3 computer to control them. The most common type is WS2812b / WS2811 AKA Neopixels.
The only problem I have run into with these is the extremely high current draw (I usually use the 144LEDs in 1meter!!) and that if one LED dies, all the ones after it stop working.

There is another less common type, WS2813 that has an extra data wire in it, so that if one light stops, the others still work, but I have not played with these yet.

The benefit of these lights is each light can do something different, and you can have some really cool effects like breathing, fading along, rainbow chase, or a larson effect.

These are what I use in the LED clothing that I make.

For most effect lighting, the standard strip lighting works well enough.

 

For single 12v colour LED strips expect to pay around $10-20 delivered

For RGB 12v expect around $15-30 delivered

for WS2812 5v expect around $8-20 per meter

5v LEDs are similar pricing to above, but you get only 2-3 meters instead of 5 (it’s still heaps!!!)

Powershell For loops

For loops have three parts:

For ($1; $2; $3){

}

$1 is the initial value
$2 is the condition
$3 is what to loop

first, $1 is checked against the condition ($2) then, $3 is run and checked against the condition, if it still matches the condition, the loop continues.
if it no longer matches the condition, the loop exits.

refer to le dodgy diagram

dodgediagram

 

Broken Example Code:

 

#I couldnt figure out the factorials and it kept getting me confused and stuck so ill use addition instead. >dealwithit.gif

clear-host
$nums =@()
$array =@()

[int]$times = read-host “how many sums will you do”

For ($i=0; $i -lt $times; $i++)
{

$num1 = read-host “enter a number”
$num2 = read-host “enter a second number”

$num3 = [int]$num1 + [int]$num2

$array = @($num1,$num2,$num3)
write-host $num1″+”$num2″=”$num3
}
For ($i=0; $i -lt $times; $i++){
write-host “Nums”`t”Sum”
write-host $array[-$array.count]$array[-2] `t $array[-1]
write-host $array[$i]`t$
}