Upgrading the Wanhao D7

The first part of this upgrade is dealt with in another post on my blog

The Wanhao D7 has a lot of promise, but is let down badly by the pretty useless UV LED array – Due to the size, there is a pretty intense hotspot in the centre, while exposure drops off towards the edges of the build plate. This makes it impossible to get consistent results across the entire build plate.

Phrozen released the ParaLED upgrade, which is a full size replacement for the UV source. As it is a generic upgrade, I have produced a shroud which allows you to remove the fan from the ParaLED heatsink and mount it on the mounting already present on the base of the D7. This has an added advantage of giving a more even airflow over the heatsink and eliminating the dead spot caused by the fan hub. The shroud also positions the ParaLED at the correct distance from the LCD. The ParaLED is becoming difficult to find, but if you google it, you may come up with some still for sale

I have also removed the Wanhao board and replaced it with a Raspberry Pi running nanoDLP and a nanoDLP shield, making the machine stand-alone.

Finally, I have replaced the stepper motor, coupler and leadscrew with an integrated motor/leadscrew. This eliminates the inaccuracies caused by the coupler expanding and contracting.

Procedure for setting up the nanoDLP shield are documented in an earlier post. The STL files, nanoDLP Machine Profile, etc are supplied here on Thingiverse

I have used a 4.3″ Nextion. In case you want to use a different size screen (more easily supported by the nanoDLP/Nextion integration), I have included the SolidWorks part file for the front cover in the Thingiverse project so that you can adjust the cutout and mounting lugs to suit your screen. If you are using the 4.3 inch screen, I have created HMI and TFT files based on the HMI for the 3.2 inch screen, and included them in the Thingiverse project for you to use when setting up your Nextion screen

In addition to the D7, Nextion and ParaLED, you will need the following:

  • An SSR-25 solid state relay – 3-32V DC input, 5-60V DC switching capability
  • An optical endstop
  • Plugs, pins and a crimp tool suitable for the on-board sockets of the shield
  • Cable suitable for hooking everything up
  • If you so desire, a Nema 17 stepper with integrated leadscrew (An adaptor is included in the printed parts if you want to do this)

The upgrade procedure is as follows:

1. Strip the D7. This is a ground-up rebuild

2. Print the parts. On the Base Extension, tap all 2.5mm diameter holes to M3. Leave the 3.5mm holes

3. Drill the original Wanhao steel base plate according to the drilling guide PDF

4. The back and left side of the ParaLED has aluminium plates attached. Remove and discard. Drill two holes in the front of the lens plate suitable for mounting the “Upper Shroud – Front” printed part. Remove the fan mounted to the ParaLED heatsink. Assemble the ParaLED to the “Shroud v2” part and attach the “Upper Shroud -Front” and “Upper Shroud – Rear” parts. The completed assembly is shown below:

5. Mount a 60mm fan to the base plate, so that it draws in air from under the machine. It is advisable to fit a filter. Do not use any of the fans that came with the ParaLED, they are 24v and will not move air.

6. Mount the ParaLed Assembly to the base plate using 6 M4x10 screws. Make sure the fan wires exit through the cutout on the base of the shroud. Mount the “Base Extension v4” part to the base plate. Use 4 M3x10mm screws. Note that two of the screws which go through from the top, where the power socket plate used to mount and two go in from underneath. Screw on the rear feet through the base plate into the base extension using M3x14mm screws – You must drill out the rear feet mounting holes with a 3.5mm drill prior to assembly.

7. Mount the various bits and pieces (Excluding the HDMI/MIPI board) on the base extension. Use M3x18mm for the Raspberry Pi and shield (use the shield standoffs between the two), M3x6mm to mount the LED power unit and solid state relay and 1 M3x14mm and one M3x10mm to mount the PSU. Make sure you run an earth wire from the PSU earth screw to the 4mm hole you drilled and tapped on the base plate

8. Remove the USB and HDMI sockets from the rear bracket. Cut off the excess where the sockets used to be, so that the bracket only holds the power socket, and is 66mm wide. Mark and drill a mounting hole that will line up with the hole in the base extension. Mount the bracket on the base extension

9. Temporarily mount the top plate. Stick the MIPI/LCD adaptor board to the side of the ParaLED lens plate with double sided tape, ensuring that the MIPI cable socket faces the rear of the machine and that the LED ribbon cable is not under any strain. Stick the MIPI/HDMI board to the base extension using double sided tape, ensuring that there is no strain on the MIPI ribbon cable. When all is correct, unplug the LCD screen and remove the top plate

10. Cable everything up. I used a 10cm HDMI cable sourced from AliExpress and a Mini USB cable also sourced from AliExpress that I cut and crimped a plug onto which mates with the 5V out socket on the shield to power the MIPI board. The SSR is used to switch the LED constant current supply – do not switch this directly from the nanoDLP shield.

11. Attach the Nextion and a 60mm fan to the front cover and install the front cover. Do not use a fan from the ParaLED kit, they are 24v and will not move enough air – YOU WILL KILL YOUR LCD SCREEN IF YOU IGNORE THIS!

12. Install the fully assembled top cover (including motor, sensor, etc.)

13. Install the upper endstop to the top of the Z axis.

14. Attach the 60mm fan to the rear cover and install

Notes

1. This is intended for a v1.5 machine, or one that has been upgraded to v1.5
2. The intention is to run positive pressure in the case. All three fans should be blowing IN.
3. The maximum width fan that can fit in the rear cover is a 6010. you can use 6020s for the shroud and front cover fans
4. The motor driver on the shield must be set up according to instructions on my blog: https://collingwood.me.uk/blog/index.php/raspberry-pi-and-the-nanodlp-shield-v1-1/
5. The machine profile from this thing must be loaded
6. For resin profiles… Currently, you’re on your own. I’ll post any working ones I develop on this thing at a later stage, feel free to add working ones you develop in the comments
7. If anything goes wrong – you’re on your own. I’m not sitting in front of your machine, and I didn’t make any of the changes made to your machine. If you do not understand basic electronics and mechanics, do not attempt this.

Raspberry Pi and the nanoDLP Shield v1.1

07 Apr 2019 – Update – nanoDLP now natively supports the Nextion (In Beta at the moment, but the beta runs nice and stable). Accordingly, the procedure has been updated

I am in the process of rebuilding my Wanhao D7, which includes dumping the Wanhao logic board and replacing it with a Raspberry Pi, putting a 4.3 inch Nextion touchscreen in the front panel and replacing the utterly useless UV light source with a full size array.

This post deals with the first two items.

I got myself a Fysetc nanoDLP shield (v.1.), which seems pretty cool and well designed. Unfortunately, it’s not all that well documented, so I’ve gone through the pain of getting it running, and documented it here, so you don’t have to.

A few notes:
• These instructions are for a Raspberry Pi 3 Model B. They may not work for other models
• The shield provides power to the Raspberry Pi. You do not have to apply power separately to the Pi
• When setting the motor reference voltage, measure between ground and the potentiometer wiper.
• For some applications (Like replacing the Wanhao D7 mainboard), you will need to reverse the motor direction
• Right at the end of all of this, I had to update nanoDLP again from the browser as per step 2.4 in order to get the Z motor to work

1. Prepare the Shield

Setting the correct reference voltage for current limiting is absolutely essential, as the entire system will shut down if the current limit is set too high. This is a major cause of people giving up on these shields early on in the game

1.1. The shield uses a DRV8825 stepper driver. Conventional wisdom out on the web suggests using the following formula to get the correct current limiting:

VREF = Current/2

However, for these shields, that formula is INCORRECT! The reason for this is simple; The standard Pololu style drivers using these chips usually use 0.1 Ohm sense resisters. However, these shields use 0.01 Ohm sense resisters, so the correct formula is:

VREF = Current/20

2. Install and update nanoDLP

2.1. Install nanoDLP on an SD card, following the instructions on the nanoDLP website

2.2. Insert it in the Pi and power it. After a while you should be able to get the webpage up. It shouldn’t matter what distribution you choose as we will load a machine profile later, but just for simplicity choose the nanoDLP generic version. The Pi will reboot

2.3. Once it has rebooted, click on the Setup then Tools tabs. Click on the Expand Filesystem button. The Pi will reboot. This will take a while and it depends on the size of your SD card

2.4. Once it has rebooted, click on the Setup then Tools tabs again. Click on the Upgrade nanoDLP button. in the new page, click on the “Upgrade to latest beta version” button. After a while, the Pi will reboot

2.5. By default, the shield turns on the UV lamp on power up, and only turns it off once nanoDLP has booted and taken control. There is now a possibility to turn it off by setting the relevant GPIO to an output and driving it low at boot time. This usually requires a firmware update as the nanoDLP firmware does not have this facility.

SSH onto the Pi
Check the firmware:

pi@raspberrypi:~ $ sudo /opt/vc/bin/vcgencmd version
Mar 16 2018 16:21:29
Copyright (c) 2012 Broadcom
version db815f3ae3dc88cf21fed2765f3b25d9d2bea67a (clean) (release)
pi@raspberrypi:~ $

We can see from this particular output that the build date is 16/03/2018 (I use the correct format for a date, DD/MM/YYYY, not the stupid American one). If the build date is earlier than 21/03/18, update it:

pi@raspberrypi:~ $ sudo rpi-update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
#############################################################
This update bumps to rpi-4.14.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=197689
##############################################################
*** Downloading specific firmware revision (this will take a few minutes)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 0 168 0 0 25 0 --:--:-- 0:00:06 --:--:-- 42
100 56.2M 100 56.2M 0 0 1213k 0 0:00:47 0:00:47 --:--:-- 2105k
*** Updating firmware
*** Updating kernel modules
*** depmod 4.14.97-v7+
*** depmod 4.14.97+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 883750dcbdfb4be32d6bc579258a07c9f664ea77
*** A reboot is needed to activate the new firmware
pi@raspberrypi:~ $

Reboot the Pi:
pi@raspberrypi:~ $ sudo reboot

2.6. Update the OS – SSH into the Pi and run the following commands:

pi@raspberrypi:~ $ sudo unlink /etc/dhcpcd.conf
pi@raspberrypi:~ $ sudo cp /boot/nanodlp-dhcp.txt /etc/dhcpcd.conf
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get upgrade
pi@raspberrypi:~ $ sudo ln -s /boot/nanodlp-dhcp.txt /etc/dhcpd.conf

Reboot the Pi:
pi@raspberrypi:~ $ sudo reboot

3. Prepare the boot config for HDMI, GPIO and Nextion.

Note that the HDMI section is for a 2k LCD panel – you will have to change it to suit your particular panel

3.1. Edit /boot/config.txt and add the following to the end of the file

# Additions for NanoDLP Shield v1.1 and Nextion

# Set up the GPIO that controls the UV array as
# an output and drive it low as soon as possible
# after power up.
# This gets around the default shield behaviour
# of turning on the array and leaving it on until
# NanoDLP is loaded.
# *** Requires firmware with a build date of 21/03/18 or later ***
gpio=5=op,dl

# Addition for Nextion screen
dtoverlay=pi3-disable-bt

# CAMERA SETTINGS ( 1 = ON, 0 = OFF)
#start_x=1
disable_camera_led=1

# DISPLAY SETTINGS
display_rotate=0x10000
hdmi_force_hotplug=1
hdmi_timings=1440 0 50 10 35 2560 0 4 2 2 0 0 0 50 0 198000000 0
hdmi_group=2
hdmi_mode=87
hdmi_pixel_freq_limit=500000000
hvs_priority=0x32ff
max_framebuffer_width=1440
max_framebuffer_height=2560
framebuffer_width=1440
framebuffer_height=2560
framebuffer_depth=24
framebuffer_ignore_alpha=1
config_hdmi_boost=4
gpu_mem=192

Reboot the Pi:
pi@raspberrypi:~ $ sudo reboot

You will notice that the blue LED next to the power terminals goes out on reboot. This is a good thing, it means that UV output is turned OFF.

3.2. Set up the serial interface and localisation
pi@raspberrypi:~ $ sudo raspi-config

Scroll down to “Localisation Options” and hit enter

When done, hit the Tab key to get to the bottom row and the right arrow key to select back.

When back in the main config screen, scroll down to “Interfacing Options” and hit enter

Scroll down to “Serial” and hit enter. Select “No” for the first question:

Select “Yes” for the second question:

Hit enter when presented with the selection feedback screen:

Use the Tab key to access the bottom selections, select “Finish” and hit enter.

Hit enter to reboot:

3.3. Disable Bluetooth:

pi@raspberrypi:~ $ sudo systemctl disable hciuart

Reboot the Pi:
pi@raspberrypi:~ $ sudo reboot

3.4. Disable the console:

Edit /boot/cmdline.txt. It will look something like this

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=b94f2c65-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

remove any console entries, so that it becomes similar to this:

dwc_otg.lpm_enable=0 root=PARTUUID=b94f2c65-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Reboot the Pi:
pi@raspberrypi:~ $ sudo reboot

3.5. Update the firmware on the Nextion screen – Download the correct TFT file from the nanoDLP Download page for your screen, copy it to an SD card, insert the SD card in the SD card reader of the screen (NOT the Raspberry Pi) and power on the screen. Updating will take just a few seconds, and the screen will tell you when it’s done.

4. Set up nanoDLP to use the shield and Nextion

Connect to nanoDLP using your web browser. Click “Setup” and select “Machine Settings”

4.1. Printer Settings

4.2. Movement GPIOs

4.3. 3D Printer Board
Don’t bother setting anything here. Enabling GPIOs in the step above disables this section

4.4. Codes
You will need to add codes specific to your printer here. I can’t tell you what they will be

4.5. Shutter

4.6. Display
You will need to add entries specific to your screen here. I can’t tell you what they will be. In order to save all of the settings you make in this section, you must at least set XY resolution

4.7. Platform/Resin
You will need to add entries specific to your screen here. I can’t tell you what they will be.

4.8. Motor
You will need to add entries specific to your screen here. I can’t tell you what they will be.

4.9. Camera Module
Leave as is

4.10. AMLCD
Leave as is

4.11. Physical Buttons
Leave as is

4.12. Hardware Fault Detection

4.13. Various Settings
If you are using a remote instance of nanDLP to slice, set the IP address and port. Set the Nextion port address.

Don’t forget to hit the Submit button

Cleaning the Anycubic Ultrabase

I got myself one of those Anycubic Ultrabase kits at the same time I designed and installed underbed piezo sensors in my Anet A6 (Prusa clone), as I was tired of messing around with glass and hairspray.

Over time, I started getting more and more bed adhesion failures until it was almost constant – this despite following the manufacturers instructions to clean with alcohol. I don’t usually use IPA, I use denatured ethanol as I get it in bulk for cheap for cleaning up my SLA resin prints. I got to wondering if the additives to denature the alcohol causes the issues be leaving behind some sort of residue. I tried IPA instead with the same result.

I got really annoyed as I had some urgent prints to get out, and succumbed to spraying a “frustration layer” of hairspray – still no dice.

Then I resorted to my go-to cleaner for anything that just won’t budge; AMMONIA!

Yes, it stinks. Yes, your wife will wonder if the cat pissed in your office. But it bloody WORKS!

There are some advantages to living in New Zealand

Australia had NBN. It would have been great, except that it got crippled when it was downgraded from FTTD to FTTN. Some lucky people still got FTTD before the pin was pulled, but most didn’t, although it seems that now FTTD is slowly being rolled out again in some urban areas, and some areas are getting FTTC

I live in a rural area of little old New Zealand. Last year, I got a flyer in the mailbox telling me I could get UFB (Our blanket term for fibre), which interested me no end as I’d been limping along on a very slow DSL connection. I figured, “Why not?”. In typical NZ fashion, it took about 4 times longer to get installed than it should have, with many false starts and a total loss of service for about a month. Everything that could go wrong did, from a mistaken cancelation of the SR to a blockage in the roadside conduit. Eventually the fibre tail from the pillar in our right of way to my house was connected to the fibre coming up the ROW and the ONT installed in my house. But was it worth it? Well, you decide:

This costs me only slightly more than the dismal DSL service I used to have. I guess we got what the Aussie NBN was supposed to have been…

New Xiaomi Aqara Button and Hass.io

UPDATE 2016-10-29

As of version 0.81, the new buttons and wireless wall switches are fully supported, so no need for this hack anymore

\UPDATE

I bought a new Xiaomi Aqara button, model WXKG11LM, and added it to my gateway. No worries, gateway picked it up and sees press, double press and hold.

Hass.io, on the other hand, knows nothing about it… I was getting a detection error with a payload of {‘cmd’: ‘read_ack’, ‘model’: ‘remote.b1acn01’, ‘sid’: ‘158d0001e79089’, ‘short_id’: 2100, ‘data’: ‘{“voltage”:3165}’} It turns out there are two different 2nd gen buttons, One which is detected as sensor_switch.aq2 and the newer one which is detected as remote.b1acn01. And while the sensor_switch.aq2 only has single and double click_types, the remote.b1acn01 has all of the click_type of the 1st generation button.

Checking the PyXiaomiGateway project on GitHub, the new 2nd generation button has been added to the xiaomi_gateway __init__.py, but this hasn’t made it through to Hass.io yet.

No problem… grab the __init__.py file from GitHub, create a directory called xiaomi_gateway under config, and put the file in there (Note, NOT config/custom-components/xiaomi_gateway). Sometimes the very last line loses its indentation which breaks everything Xiaomi, so check it and make sure it’s still indented correctly. But all of this this still didn’t work, the button was still not detected….

Further digging showed that it also has to be added to xiaomi_aqara.py file in binary_sensor. No problem, head over to to the raw file on GitHub and grab it. If you don’t already have one, create a directory called custom_components under config. In this directory, create a new directory called binary_sensor in in this directory create a new file called xiaomi_aqara.py, and paste the raw file into it. Then edit line 39 and change it from:

                           'sensor_switch.aq2', 'sensor_switch.aq3']:

to

                           'sensor_switch.aq2', 'sensor_switch.aq3', 'remote.b1acn01']:

And restart Home Assistant

Hass.io and Alexa

UPDATE: I am only a haaska user, not one of the developers. If you have any issues following any of the steps below, please take it up with the developers on Github, not here with me, as I can’t help you.

I used to have my Has.io installation working quite nicely with Amazon Alexa through the Home Assistant Cloud. It integrated my Philips Hue lights, Sonoff light switches, Logitech remote, Sonos speakers and Aqara sensors quite nicely. Then Nabu Casa decided they were going to charge US$ 5.00 a month for the pleasure. Now I’m a bit of a tightarse… I pay less for my VPN which gives me access to US Netflix, Pandora (Now that they’ve pulled out of NZ) and a host of other nice things – so for what you get, it really didn’t seem like value for money.

After a bit of reading, I came across haaska. It looked like it would fit the bill, only one problem – the documentation relating to setting it up is, shall we say “A little challenging”; There’s a fair bit of prior knowledge assumed which prompted me to author this.

So after struggling through it for a few hours including going off and getting information that is really lacking, here is my idiots guide to getting it working. Please note, I’m making the assumption that you have a working python installation, including pip, and a working GNU development environment. Without these two prerequisites, you will not be able to get this working (I really don’t know why the developer has not provided a zip file with a blank config.json file that can be uploaded to AWS, as the function files CAN be edited in the Lambda console…!). You must also be able to set up port forwarding in your router. As all three of these prerequisites are highly environment specific, they are out of the scope of this guide.

1. Be running HA  0.62 or better

2. You will be building an Alexa skill on Amazon Web services. There are two things to bear in mind here: Your skill will need to connect to your HA installation, and for your own sake, it will need to do so via HTTPS, NOT HTTP. With that in mind, there’s a lovely little HA add-on that does what we need, but first we need to set up our account with the dynamic DNS provider:

2.1. Go to Duck DNS. Create an account and log in.

2.2. In the Domains tile, type a subdomain name that means something to you in the empty text box labeled “sub domain”. Click the “add domain” button.

2.3. Copy the token value in the top tile

2.4. On your HA console, click Hass.io, select the Add-On store and click the Duck DNS tile then click install

2.5. Update the Duck DNS Add-on config so it looks like this:

{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "<your token from step 2.3.>",
  "domains": [
    "<your subdomain from step 2.2.>.duckdns.org"
  ],
  "seconds": 300
}

2.6. Slide the sliders next to “Start on boot” and “Auto update” to the right.

2.7. In your configuration.yaml file, add or edit the http: section so that it looks similar:

http:
  base_url: https://<your subdomain from step 2.2.>.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

2.8. Add the following two entries into your configuration.yaml file:

api:

alexa:
  smart_home:

2.9. Note that you have now enabled SSL on your Hassio installation. Accordingly, you will have to update your plugins if they open a frame (Like Configurator or TasmoAdmin for example) – in the plugin config, set SSL to true

2.10. Restart Hassio. Bear in mind that you have enabled SSL, so use https:// not http://

3. Create the zip file to upload to AWS as per the following steps:

3.1. In the top left hand corner of the HA console, you will see a blue circle with a letter in it (The letter is the first letter of your HA user name), just to the right of the “Home Assistant” text. Click this, scroll to the bottom and in the “Long Lived Access Tokens” tile, click “Create Token”. Enter “haaska” (without the quotes) as the name, and copy the access token that is generated to the clipboard

3.2. Download the repository zip file from GitHub

3.3. Unzip the zip file. In the resulting directory, go to the config directory and copy config.json.sample to config.json

3.4. Edit the config.json file as follows:

{
  "url": "https://<your subdomain from step 2.2>.duckdns.org/api",
  "bearer_token": "<the token you created in step 3.1>",
  "debug": true,
  "ssl_verify": true,
  "ssl_client": []
}

3.5. Go one directory level up from the config directory and run make. This will create a file called haaska.zip if everything is working properly. If it isn’t, you’ve got a problem with your environment as noted above in the third paragraph of this guide – Please don’t ask me to fix it for you, as I’m not sitting in front of your machine.

4. Set up port forwarding on your router. You will need to forward ports 443 and 8123 on the WAN interface to port 8123 on the IP address your Hass.io machine. Again, if you don’t know how to do this, please don’t ask me to fix it for you, I’m not sitting in front of your router.

5. Register with Login with Amazon as follows:

5.1. Go to the Amazon Developer Console. If you have an account, sign in, otherwise create an account

5.2. Once signed in, click on the “Login with Amazon” link on the top menu ribbon

5.3 Click on the “Create a New Security Profile” button. Give the profile any name you like and enter anything for the privacy URL. Save it

5.4. Click the dropdown next to the profile (With the gear on it) and click “Web settings”. Leave this tab open, you’ll be coming back to it later

6. Create an Alexa skill and a lambda function. These are a bit of chicken and egg, as you need the Alexa skill ID in the Lambda function, and you need the Lambda function ID in the Alexa skill – Yes, a bit dumb…

6.1. Open a new browser tab, and go to the developer console. Hover over the Alexa menu item and click on Alexa Skills Kit

6.2. Click the “Create Skill” button.

6.3. Enter the skill name (I suggest “haaska”), the default language (I would suggest the language you have set in your Alexa devices) and click the “Smart Home” tile to select it. Then click the “Create Skill” button

6.4. Select v3 for the payload version.

6.5. Leave the skill tab open, and log into your AWS account. If you don’t have one, create it and log in. A word of warning – you will be required to provide credit card details when creating your account. There should be nothing to worry about, as all of what we’re going to use should be free forever, but just keep an eye on your statements just in case.

6.6. If you have never used Lambda before, you will need to create an IAM Lambda Basic Execution role. If you  have already done this, skip to 6.7:

6.6.1. Click on the “Services” flyout on the top menu ribbon, and select “IAM” under the “Security, Identity and Compliance” heading

6.6.2. On the left hand side, click “Roles”

6.6.3. Click the “Create role” button

6.6.4. Ensure the AWS service tile is selected and Click “Lambda”, then the “Next: Permissions” button

6.6.5. type “basic” into the filter box, click the checkbox next to  “AWSLambdaBasicExecutionRole” and click the “Next: Tags” button. Don’t add tags, just click the “Next: Review” button

6.6.6. Enter “lambda_basic_execution” in the “Role name” box and click the “Create role” button

6.7. *CRITICALLY IMPORTANT* There is a dropdown to the right of your username in the top right corner. You *MUST* select the correct location according to the entry in the “Lambda Function Region” column associated with the default language of your skill set in step 6.3 as per the following table:

Skill language Endpoint Region Lambda Function Region
English (US), English (CA) North America US East (N. Virginia)
English (UK), French (FR), German, Italian, Spanish (ES) Europe, India EU (Ireland)
English (IN) Europe, India EU (Ireland)
Japanese, English (AU) Far East US West (Oregon)

6.8. Click on the “Services” flyout on the top menu ribbon, and select “Lambda” under the “Compute” heading

6.9. Click on the “Create Function” button and select the “Author from scratch” tile

6.10. Enter “haaska” in the Name box and select “Python 3.6” in the Runtime box

6.11. Select “Choose and existing role” in the Role box and “lambda_basic_execution” in the Existing role box. Click the “create function” button

6.12. in the “Function code” tile, select “Upload a .zip file” in the “Code entry type” dropdown

6.13. Click the “Upload” button, and select the zip file created in step 3.5

6.14. Change the entry in the “Handler” text box to “haaska.event_handler”

6.15. Ensure that the “Choose an existing role” is selected in the top dropdown of the “Execution role” tile, and that “lambda_basic_execution” is selected in the bottom drop down.

6.16. In the “Designer” tab, select “Alexa Smart Home” from the list on the left. If you don’t see it, you have an incompatible location set in step 6.7; I discovered this by setting my location to EU (London) as my language is English (UK)…NO! According to the table, your location must be EU (Ireland) for English (UK) – Go figure!

6,17. In the new “Configure Triggers” tile that appears, paste the skill ID copied from the tab left open in step 6.5 into the “Application ID” text box and click the “Add” button

6.18. Click the orange “Save” button at the top left. Leave this tab open, we will be coming back to it.

6.19. Copy the ARN as shown near the top right of the page, then paste it in the “Default endpoint” box in the tab left open in step 6.5. * CRITICALLY IMPORTANT! * You must also select the geographic region according to the “Endpoint region”  and default language in the table in step 6.7 and paste the ARN in the associated text box. Failure to do so will ensure haaska does not work

6.20. In the tab left open in step 6.5, click save and then on “Account linking”

6.21. Set “Authorization URI” to https://www.amazon.com/ap/oa, set “Access Token URI” to https://api.amazon.com/auth/o2/token, set the Client ID to the value from the tab left open in step 5.4, set “Client Secret” to the value from the tab left open in step 5.4, add a scope and enter “profile” in the resulting text box. Leave everything else as-is, click save and leave the tab open

6.22. Go back to the tab left open from step 5.4. Click the edit button Enter the “Redirect URLs from the tab left open in step 6.21 as “Allowed return URLs”

You can now test your work as per this and set it up for use as per this

Realview and OpenGL in Solidworks in Parallels on the Hackintosh

Those orange lines in a Solidworks drawing when mousing over a part… they were taking FOREVER to render! So, I did a lot of research, and this is what I found:

  • RealView was greyed out:
  • Solidworks was using Software OpenGL with no way of disabling it:

Now I have an Nvidia GForce GTX 770 graphics card in my Hackintosh. It’s not the best, but it’s also no slouch and it certainly is capable of doing the nice stuff with Solidworks… with a registry hack or two…

DISCLAIMER – I’m not sitting in front of your computer. You are. If anything stops working or breaks after following my instructions, it’s all your fault, not mine.

  1. Solidworks supports the really high-end Nvidia cards. This means the Quadro series mainly. The GTX 770 isn’t supported. However, it’s closely related to a Quadro. Over to Wikipedia, and we discover that it’s closest relative is the Quadro K5000:  This gives us some really usefull information. We’re going to make Solidworks think we’re running a Quadro K5000!
  2. Now we need to hack the registry. Open it using regedit and BACK UP YOUR REGISTRY!!! DO IT!!!
  3. Under HKEY_CURRENT_USER\Software\SolidWorks\SolidWorks <your Solidworks version>\Performance\Graphics\Hardware\Current, copy the value for the Renderer string:  in our case, it’s “Parallels using NVIDIA GeForce GTX 770 OpenGL Engine”
  4. Under HKEY_CURRENT_USER\Software\SolidWorks\SolidWorks <your Solidworks version>\Performance\Graphics\Hardware\Gl2Shaders\NV40 find the Quadro K5000 key and note the value for the Workarounds DWord:In our case, it’s 40408
  5. Right click on the  HKEY_CURRENT_USER\Software\SolidWorks\SolidWorks <your Solidworks version>\Performance\Graphics\Hardware\GI2Shaders\Other and select “New” and “Key”. Paste the value that you copied from step 3, but remove reference to OpenGL. In our case it becomes “Parallels using NVIDIA GeForce GTX 770” (Without the quots)
  6. Right click in the right window and select “New” and “DWORD (32-bit) Value”. Name the new DWord “Workarounds” (without the quotes) and set its value to the value found in step 4 (in our case, 40408):
  7. Now select HKEY_CURRENT_USER\Software\SolidWorks\SolidWorks <your Solidworks version>\Performance\Graphics\Hardware\Parallels and NVIDIA Corporation and set the “Workarounds” DWord value to the value found in step 4 (Again, in our case, 40408):
  8. Now select HKEY_CURRENT_USER\Software\SolidWorks\SolidWorks <your Solidworks version>\Performance\Graphics\Hardware\Parallels Inc. and NVIDIA Corporation and set the “Workarounds” DWord” value to the value found in step 4 (Again, in our case, 40408):
  9. Exit Regedit. This saves the registry

You now have working hardware OpenGL:and working RealView:This should work for other card models too, provided you select the correct Workarounds value

Why NZ Businesses are Trying to Lower the Import Tax Threshold

I need a few parts for my car to renew the suspension. Usually one would be able to just press out the bushes and ball joints and replace them, and while it’s possible to do the bushes, the ball joints are not replaceable and require new upper and lower control arms.

I sourced a kit of parts a few months back from the US, but haven’t yet got around to installing them, From memory the entire kit, which consisted of two lower control arms, two upper control arms, two tie rods, two stabiliser bar linkages and two rear stabiliser linkages cot me a total of around NZ$400. Local prices had just ONE lower control arm costing more than the entire kit cost.

I also decided to renew the stabiliser bar bushes. Four are required as each one is effectively half a bushing. I sourced these from Ireland, Febi parts which are OEM. Each one cost me about NZ$ 5.00. The price at a local dealer is around NZ$ 30.00 each.

On reading up the manufacturers procedures for replacing the suspension components I realised I would have to fit some new bolts as they are Torque-To-Yield, not Torque-To-Spec, and new nuts as they are one-shot lock nuts. I’d also need to replace the clamps for the tie rod boots, and I decided to replace the boots as well due to the mileage of the car (One of the “clunk” culprits is a badly worn inner tie rod ball joint). I got all the part numbers and contacted the local dealers for prices. NZ$ 342 was the total. I got on to an overseas dealer to get a quote and wasn’t too surprised to found out that all of the same parts, plus shipping was immensely cheaper – NZ$ 265.

The long and short of it is that we are being ripped off on a daily basis by importers who have almost no domestic competition, so they cream huge markups. They are crying because the internet has opened up a literal world of possibilities to the NZ consumer. I am quite happy to bypass them and order whatever I need from overseas, and screw them.

I’ll document the replacement of the suspension components here when the last parts arrive and I get the job done

Spammers, Scrapers, Bots and Other Assorted Undesireables

I make a habit of checking the logs on my servers every now an then, just to make sure all is good. This includes the HTTP access logs, the mail logs as well as the system logs.

I found a few interesting things recently

  1. Attempted abuse via TOR. There’s been quite a few attempts to access pages that no longer exist. When I’ve checked the source IPs, they’ve turned out to be TOR endpoints. Seeing as these access attempts always come with some VERY dodgy arguments, all incoming traffic from TOR endpoints is now dropped. There is no reason for TOR usage when trying to access my servers, so any attempts to access any of my servers vi TOR is considered to be hostile. The same goes for some very dodgy proxy providers in Sweden.
  2. Ararat Synapse. There’s a few badly built bots using these libraries. They are now blocked, and more than two access attempts from the same IP address will cause the offending IP address to be firewalled.
  3. SMTP. My SMTP server is now only advertising AUTH to certain ranges of IP addresses. Any host attempting to authenticate when AUTH hasn’t been advertised is firewalled.

5280 Enterprises AKA Proxy51 – A nest of scrapers, spammers and general scum

Spammers are scumbags. Those who facilitate the spammers for commercial gain are even bigger scumbags. 5280 Enterprises AKA Proxy 51 are just one of these even bigger scumbags. They permit spammers to hide behind their proxies and do absolutely nothing to prevent it happening, and do absolutely nothing to stop them when it’s reported. This is what’s fallen into the honeypot in just the last 24 hours:

23.29.55.0/24 – DM Systems 2013-07-12
23.29.56.0/23 – DM Systems 2013-07-12
23.29.58.0/24 – DM Systems 2013-07-12
38.87.64.0/20 – Cogent 2013-07-12
50.117.46.0/24 – EGI Hosting 2013-07-12
50.117.64.0/17 – EGI Hosting 2013-07-12
50.117.73.0/24 – EGI Hosting 2013-07-12
69.46.81.0/24 – EGI Hosting 2013-07-12
142.54.170.0/24 – Datashack 2013-07-12
142.54.20.0/24 – Datashack 2013-07-12
142.54.171.0/24 – Datashack 2013-07-12
172.232.86.0/24 – Eonix 2013-07-12
173.208.145.0/24 – Wholesale Internet 2013-07-13
173.232.46.0/24 – Eonix 2013-07-12
173.232.124.0/24 – Eonix 2013-07-12
199.116.84.0/22 – DM Systems 2013-07-12
205.164.9.0/24 – EGI Hosting 2013-07-12
205.164.13.0/24 – EGI Hosting 2013-07-12
205.164.15.0/24 – EGI Hosting 2013-07-12
205.164.57.0/24 – EGI Hosting 2013-07-12
216.172.139.0/25 – EGI Hosting 2013-07-12
216.172.141.0/25 – EGI Hosting 2013-07-12
216.172.145.0/24 – EGI Hosting 2013-07-12

What’s also interesting to note is that the hosting/collocation providers are also made up of the usual suspects. Feel free to go ahead and firewall the ranges identified.