Wednesday 30 March 2022

Adafruit RP2040 QT Trinkey woes and working example

 Having just bought one of these potentially delightful devices, I now find myself in the wilderness of getting started.

I got past Hello World and then thought I would try using the NeoPixel.

https://www.adafruit.com/product/5056

with 'white' buttons

Product is listed as 

Adafruit Trinkey QT2040 - RP2040 USB Key with Stemma QT


Here's how to get started..


#1 load the latest firmware

https://www.adafruit.com/product/5056

with 'white' buttons

circuit python port

https://circuitpython.org/downloads

the only trinkey with PI is

https://circuitpython.org/board/adafruit_qt2040_trinkey/

So lets get the firmware..

You get linked to..

https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/adafruit_qt2040_trinkey/en_GB/

take the top uf2

I used

https://adafruit-circuit-python.s3.amazonaws.com/bin/adafruit_qt2040_trinkey/en_GB/adafruit-circuitpython-adafruit_qt2040_trinkey-en_GB-20220329-07f8ceb.uf2

hold down both buttons then drag the file into RPI-RP2 folder

Now you will need the library

(https://circuitpython.org/libraries)

copy the lib folder over


Eventually I got it working with the following code

# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries

# SPDX-License-Identifier: MIT

print("hello")

"""CircuitPython Essentials NeoPixel RGBW example"""

import time

import board

import neopixel

#import digitalio

pixel_pin = board.NEOPIXEL

num_pixels = 1

#print(neopixel.__version__, neopixel.__file__)

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)

pixel.brightness = 0.01

#print(pixel)

ps=0.2

#ps=1

while True:

    #BRG

    pixel.fill((0, 0, 255))

    pixel.brightness = 0.05

    time.sleep(ps)

    pixel.brightness = 0.01

    pixel.fill((255, 0, 255))

    time.sleep(ps)

    pixel.fill((255, 255, 255))

    time.sleep(ps)

    pixel.fill((255, 255, 0))

    time.sleep(ps)

    pixel.fill((0, 255, 0))

    time.sleep(ps)   

    pixel.fill((0, 0, 0))

    time.sleep(ps)

#test = pixel[0].getPixelColor()

#pixel.fill((125, 0, 1))

pixel.show()

#pixel.fill(255,0,0)

#pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3, auto_write=False)

print("goodbye")




Monday 28 March 2022

Creating the next generation NiteSave - reducing reliance on fossil fuels

Thanks to Nitesave.com founder Mark N hopgood for these plans. This is a work in progress.


Part 1: How to make the NiteSave switch for laptop, raspberry pi and stand alone.

NiteSave is a switch that allows you to really reduce your reliance on fossil fuels. 

Linked with a battery or power wall it uses smart tracking to reduce your fossil fuel consumption in the following ways.


Utilise solar power - even if you don't have panels yourself.

Take advantage of waste energy production

Nitesave powers its batteries when the sun is out and when waste energy is available.


The power of it all lies in a switch with a tracker.


Kit list..

1. PC, laptop or raspberry pi

2. Microcontroller, e.g. 
Adafruit trinkey - https://thepihut.com/products/adafruit-trinkey-qt2040-rp2040-usb-key-with-stemma-qt?variant=40019715784899
~£9 inc. shipping

3. I2C port expander
https://www.hobbytronics.co.uk/pcf8574an-i2c-port-expander

~£6 inc. shipping

4. 3 x spring mount terminals.
https://www.hobbytronics.co.uk/spring-terminal-4?search=4%20pin

~£8 inc. shipping

5. Prototype board
https://www.ebay.co.uk/itm/154352499080

6. 8 channel relay board ( sponsored )
https://amzn.to/3JNy8Kg

Cables.

Mini Micro JST 2.0 PH 4-Pin Connector plug with Wires Cables
~£5.46


Tuesday 21 June 2016

Brick Flip Smart - Project Management Methodology and Analogy

Brick Flip Smart 
Analogy and Project Methodology





Analogy:
Mobile phones have evolved from a Brick phone, which allows you 
to make calls on the move.

Following that, the flip phone was popular - this was a more
compact phone with extra features such as playing music instead 
of a ringtone and taking photos and playing games - also allows you
to make calls on the move. 

Now smart phones are ubiquitous with bright touch screens. You 
can easily connect to the internet, play movies and games. They 
also allow you to make calls on the move.

Methodology:
Aim to make an initial system with base functionality that can be
used for the majority of purposes (Brick). Additional modules can be added
afterwards in a staged way (Flip). Allowing the control of development and
costs aligned with the business. Eventually the system will be completed with all features desired ( Smart )

In addition, a halt in budget still results in usable product.

Contact mark@hopgood.eu to discuss how your business could benefit from a methodology and supportive system.

Wednesday 11 May 2016

#web_crm - CRM systems from Hopgood Marketing & Consultancy

With the rise of search, its no longer relevent to have a domain name.
An alternative for life is to register a hashtag with http://inumberz.com


This gives you access to the following types of hashtag that span across twitter, facebook and more.


e.g. #web_crm - Hopgood Marketing & Consultancy Ltd - uk based specialists in business systems on the web.


Friday 25 July 2014

Samsung SE-208BW Optical Smart Hub as a file and optical drive server for home and office (30 mins - 1 hour)

How I use the SE-208BW Optical Smart Hub.

For some people with prior knowledge of networks and systems, the Samsung Optical Smart Hub (ODD) can be confusing.

It certainly took me a couple of hours to configure, but once I knew its limitations, I had it sussed and it is now working sweet.

I use the device in the following way - SAMBA / FTP server on wired network. There is a hard drive attached to the smarthub. PCs and tablets can access files directly.

FEATURES I SWITCH ON / OFF after all is setup

WIRELESS - OFF
DLNA - OFF
SAMBA - ON
FTP - ON
iSCSI initiator - ON
I'll explain why later.



When powered up initially, this device will act as an SSID (wireless hub) so you here's the steps that worked for me in setting up this amazing device.

RECIPE FOR SUCCESS
You will need

A Wired network to the internet. This is to receive the update files.
A PC / Laptop with wireless network adapter
A PC / Laptop with a Wired network connection.
Preferably 2 PCs - one for wired and one for wireless.
A copy of colasoft mac scanner - to check the device on your LAN
To know your ip address range on the wired network and have a spare ip address that you can assign to the device.

As long as you have these it will work well.

Steps to take
Make sure you can connect and setup the wired connection.
1. Power on the smarthub and wait until the power light stays on continuously. This can take up to 3 minutes.
2. Connect the PC with wireless to the smart hub - SSID will be as mentioned on the underside of the hub.
3. Run the software from the CD, or...

If like me you don't have a CD drive attached to your PC, check your IP address using IFConfig (Linux /OSX) or IPConfig (PC)

Your IP address will be something like 192.168.208.2 and the default gateway will be 192.168.208.1
This is the address to put into the browser now.

According to the manual, it says...
1. Run a web browser and enter http://smarthub in the address box.
2. When the Optical Smart Hub log-in page opens, enter your password.
There is no password set in the factory default state. When you connect to the Optical Smart Hub for the
first time, click the Login button without a password

This is how the smarthub names / refers to the networks

LAN - the wireless network exclusive to the smarthub
WAN - the wired network

Confused? I was. But not anymore.

SE-208BW USER MANUAL
http://org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=UNI_LATIN_EN&CttFileID=4949622&CDCttType=UM&ModelType=N&ModelName=SE-208BW&VPath=UM/201202/20120229112036462/SE-208BW_User_Manual_Eng.pdf

Now check the wired network - plug in the network cable into your switch and then the smarthub.
On the PC that has a wired connection, type http://smarthub or use colasoft mac scanner free to scan for new network devices and get the IP address from the entry that says SMARTHUB

An example setup.

Initially I chose the following configuration changes.

Keep the wireless / LAN settings the same.
WAN - Change the IP address to be fixed.
My IP addresses are typically 192.168.1.xxx so I gave my smarthub a WAN IP address of 192.168.1.54 (which I can easily remember as I think 54 is like SH)

Check that you can login using the new WAN IP address. Make Sure by connecting from a PC that has no wireless or disconnect wireless completely from the PC.

If you got to this stage, congratulations.

FIRMWARE UPGRADE - make sure no USB drives are connected. I toasted my USB Key, but not to worry as I had a backup ;-)

As long as your LAN (WAN according to smarthub) wired network has access to the internet, you can go ahead and now upgrade firmware. Takes about 10 mins max depending on your internet speed.



Making the device run cool.
The Samsung SE-208BW Optical Smart Hub can run really hot. Here's a way to cool it down.
Once I have everything up and running I switch off Wireless completely as I run my smarthub as a wired hard drive.

I also access files on my usb hard drive using my smartphone by installing ES File explorer.

Let me know if you need any further info.

Hope this info helps.
mark@hopgood.eu

Update -

I've started looking at the firmware with a view to  getting the most of smarthub.
So far I know that there is busybox and telnet.

Anyone know username password.?

Thursday 19 June 2014

Resolving disk space issues for backup with LVM2

When I look to assisting clients with their near line and off-site backups, I used to come across the issue of "disk creep". This is where a disk gets full, so another disk (USB or Network Attached Storage) is purchased. Eventually you have a succession of 4 or more backup disks with no real backup.

So the approach I have started taking is to use the previous 4 disks as a backup for the new bigger disk.




The idea is that disk capacities have grown and grown because of the adoption of spintronics, we are now able to have 1TB, 2TB - 4TB disks - many times more than 7 years previously.

In this example we have a new 2TB drive, 2 x 500GB Sata drives, a 300GB PATA IDE and a 500GB Pata IDE


Here are the steps I take.

1. copy all data to new drive.
2. verify data using beyond compare
3. in this case make a joined up disk using the old disks ~1.8TB which should be enough to backup the new drive

Joining the "old" disks using LVM

Firstly I use the smallest drive to install a 6GB partition for Lubuntu 64 - a lightweight linux ditribution.
I then leave 2GB for swap and format the rest as a primary partition as ext4 (292GB)

I do this on the 300GB PATA then I format the other disks (500GB) as ext4.

My aim is to create a volume called /buv/buv1 which will be 1.8TB

buv stands for Back Up Volume - you can call it something different if you want.

I open a terminal on the Lubuntu Machine (Ctrl-Alt-T)

Second thoughts - perhaps I should have put the OS on one of the SATA drives then I could have duplicated the OS in case of failure of one device.







Friday 6 June 2014

Making my dvd-ram writable in Debian

Firstly

apt-get install dvd+rw-tools udftools

Then I knew my dvdram drive was /dev/sr0


Then I formatted - not sure if I needed to do this
# format dvd-ram (optional)
dvd+rw-format -force=full -ssa=default /dev/sr0

then I issued

mkudffs /media/cdrom

However mine was /dev/sr0
Then I mounted

mount /dev/sr0

then I mount as per

mount /mnt/dvdram

http://www.panticz.de/node/355
http://mandrivausers.org/index.php?/topic/45839-mounting-and-formatting-dvd-ram/