0 Comments

As I’ve blogged a while ago (july 2019), I made my pi a docker host. I used a pi 3, but moved now to a pi 4 with ubuntu as host.

If you want to know how I did it, my collegeau Johan explains it on his blog How to install Ubuntu on a Raspberry PI – Johan the Developer and the followup How to install Docker on a Raspberry PI – Johan the Developer

Once you have that in place, you can proceed to get a Nebl Docker container.

The Nebl Docker container

I found this official one on dockerhub neblioteam/nebliod-rpi (docker.com)

The instructions are always clear at dockerhub. Step 1 is to get the image:

docker pull neblioteam/nebliod-rpi

Step 2 is to use the image to run a container:

sudo docker run -d --restart=always --name nebliod -v $HOME/neblio-data:/root/.neblio -p 6325:6325 neblioteam/nebliod-rpi


If you are less familiar with Docker, this does mount the folder /root/.neblio in your container to the folder on your docker host at the home or ~ and then neblio-data. This contains your wallet which password is generated at the 1st start of the container.


Use the container

I started a shell in the container, so it will save me some typing:

sudo docker exec -it nebliod bash

you can get your wallet address with this command:

nebliod listreceivedbyaddress 0 true


If you would not start bash first, but just run it from your docker host:

sudo docker exec -it nebliod nebliod listreceivedbyaddress 0 true


You can see that the password is random on line 16 here

docker-nebliod/neblio_init at master · NeblioTeam/docker-nebliod (github.com)

You should transfer Nebl to your wallet. It will take 24 hours to mature. Then the weight will gain for staking.

Run the nebliod getstakeinginfo to see the weight, if the coins are mature and the expectedtime in seconds for staking.

You can also use nebliod getbalance to just get the balance from your wallet without the address and confirmations which the listreceivedbyaddress returns.

So it’s all up and running 24/7 on my Raspberry Pi 4. Now it’s just a matter of time before I will receive the first stake.


If you want to know more about Neblio, please check out their website at Neblio - Blockchain. Simplified.


Good luck! I hope it’s helpful

Post on LinkedIn
0 Comments

There are a lot of guides on how to install Pi-hole on a pi. I just used the win32DiskImager to put Rasbian on it and I did put an ssh.txt file on the SD card to enable SSH. I just had to plug it in the pi and wait for it to show up on the DHCP list of my router so that I knew the IP to ssh to.

I have an archer c7 router which has “DNS rebind protection” so I could not change the DNS to the local IP address.

In order to fix it I had to go to the Archer web interface and follow these steps:

Add in dhcp –> dhcp settings, set the primary DNS to the local ip

in the dhcp –> address reservation “add new “ paste the mac address which you can find in dhcp –> dhcp clients list.

and the local ip which the pi has. This makes sure that the next reboot, the pi/dns server will have the same lan IP.


By the way, I had an issue with the ‘ftl’ part in the installation of pi-hole

I fixed it with : `sudo nano /etc/resolv.conf`

add a line with: `nameserver 8.8.8.8`

That is the google dns and that makes sure that there is a know dns so that the installation can lookup ip’s and continue.

Save the .conf file and run `sudo bash /etc/.pihole/pihole –r`


That will repair the installation and the FTL part will succeed now that there is an dns entry to the google dns in the resolv.conf


Good luck!

ps. please let me know if you know a way to block youtube ads. No browser plugin, but a pi-hole solution please.

Post on LinkedIn

Recently the Raspberry Pi 4 was announced, But I am currently using my rpi 3test_1 and want to run Rabbit MQ on it in Docker. So I used these two commands to get it to work and I just wanted to share it:


sudo rm /etc/apt/sources.list.d/docker.list;

curl –sL get.docker.com | sed ‘s/9)/10)’ | sh

If you would like to use Docker as a non-root user you should add your user to the docker group:

sudo usermod –aG docker pi

To get Rabbit MQ (which has arm container) on the pi with a management web interface run:

sudo docker run –d –hostname my-rabbit –name some-rabbit –p 15672:15672 –p 5672:5672 rabbitmq:3-management

Then get the ip of the docker container with (but since you added the ports in the previous command, this step can be skipped):

sudo docker inspect –f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ some-rabbit

Then you can launch a browser and go to http://thatipaddress:15672 and login with 'guest/guest'. If you did not lookup the ip of the container you can use the ip of the pi because you opened container ports when running it.


8850828555_df7c7bd300_b


Good luck!

Post on LinkedIn

It all starts with installing Windows 10 IoT on a suitable device. I used a Raspberry Pi 2 (Model B) and installed the creators update of Windows 10 IoT. You should really get the dashboard from Microsoft: https://developer.microsoft.com/en-us/windows/iot/downloads

snip_20170504105939

It is really easy to get Windows 10 IoT on your device. Here is a small manual https://developer.microsoft.com/en-us/windows/iot/docs/iotdashboard

snip_20170504111010

If you have your Visual Studio 2017 configured, you can easy deploy to it.

The hardware

I bought stuff from aliexpress. I had no rush, so saved a lot of money Smile

I was inspired by this article https://www.modmypi.com/blog/raspberry-pi-plant-pot-moisture-sensor-with-email-notification-tutorial but that referenced to a moisture sensor for 4 gbp and shipping was also 4 gbp. So just the sensor could cost me 9,40 eur. Which makes it less fun, because the whole idea of a raspberry pi is that you can make an internet of things device with little costs.

 

I spend only 42 cent on the sensor and bought some male/female, male/male, female/female jumper cables too and even an hdmi to dvi connector so I could connect an external monitor, but never used it.

Ali Url snip_20170504112536

€ 0,42

Ali Url snip_20170504112647

€ 2,19

Ali Url snip_20170504113017

€ 1,14

(optional)

So I had to spend € 2,61 euro including shipping to get the parts for my Pi 2.

Hardware wiring

Connect the probe to the sensor with two wires. Doesn’t matter which goes where.

Connect the sensor to the GPIO

VCC 3v3 Pin 1
GND GND Pin 9
D0 GPIO 17 Pin 11

 

WP_20170406_17_01_50_Pro

WP_20170406_17_01_40_Pro

WP_20170406_17_01_26_Pro

WP_20170406_17_01_13_Pro

this is a good page for gpio pins: http://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/

snip_20170504134958

Software

I hit a strange bug with the UWP but fixed it, thanks to stack overflow, by manual creating a project.json file. As said, I was inspired by this article but that is coded in Python. My preference language is still C# and I wanted to try win 10 iot. So I rewrote this python code to C# and got this: 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Http;
using Windows.ApplicationModel.Background;
using Windows.Devices.Gpio;
using Windows.UI.Core;
using System.ServiceModel;
using LightBuzz.SMTP;
using Windows.ApplicationModel.Email;

namespace BackgroundApplication1
{
    public sealed class StartupTask : IBackgroundTask
    {
        private const int SENSOR_PIN = 17;
        private GpioPin pinSensor;
        private BackgroundTaskDeferral deferral;

        private const string SMTP_SERVER    = "smtp-mail.outlook.com";
        private const string STMP_USER      = "YOURPLANTSADDRESSHERE@hotmail.com";
        private const string SMTP_PASSWORD  = "YOURPASSWORDHERE";
        private const int    SMTP_PORT      = 587;
        private const bool   SMTP_SSL       = false;

        private const string MAIL_RECIPIENT = "iwillwatertheplants@hotmail.com";

        public void Run(IBackgroundTaskInstance taskInstance)
        {
            deferral = taskInstance.GetDeferral();

            taskInstance.Canceled += TaskInstance_Canceled;

            var gpio = GpioController.GetDefault();

            if (gpio != null)
            {
                pinSensor = gpio.OpenPin(SENSOR_PIN);

                var r = pinSensor.Read();

                pinSensor.SetDriveMode(GpioPinDriveMode.Input);

                var dm = pinSensor.GetDriveMode();

                pinSensor.DebounceTimeout = TimeSpan.FromMilliseconds(50);

                pinSensor.ValueChanged += PinIn_ValueChanged;
            }
        }

        private void PinIn_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
        {
            if (pinSensor.Read() == GpioPinValue.High)
                SendMail("Thirsty", "Plant needs water");
            else
                SendMail("I am good", "Plant is fine again");
        }

        private async void SendMail(string subject, string body)
        {
            using (SmtpClient client = new SmtpClient(SMTP_SERVER, SMTP_PORT, SMTP_SSL, STMP_USER, SMTP_PASSWORD))
            {
                EmailMessage emailMessage = new EmailMessage();

                emailMessage.To.Add(new EmailRecipient(MAIL_RECIPIENT));
                emailMessage.Subject = subject;
                emailMessage.Body = body;

                await client.SendMailAsync(emailMessage);
            }
        }

        private void TaskInstance_Canceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
        {
            pinSensor.Dispose();
        }
    }
}

I used the nuget "lightbuzz-smtp" to send mail https://github.com/LightBuzz/SMTP-WinRT

Have fun with Windows 10 IoT raspberries etc.

Post on LinkedIn
0 Comments

If you do not yet have a solution to watch pictures and movies on your TV, you really should buy a Raspberry Pi. It is around 40 euro and needs an SD card, USB to micro USB and HDMI cable. And last but not least some free Linux distribution with the famous XBMC. I have blogged before about RaspBMC but I have moved to Xbian because there are more developers involved and some are Dutch. You can reference network locations on your small raspberry xbmc to list the movies inside them. There are several solutions to make that reference. One is samba. This works great, but samba has some protocol overhead. NFS is an other option and is more ‘lightweight’. 

image

So download the windows installer for Xbian .  Or check this page for other operating system options. Put it on your SD. put the SD in your pi and power up and make sure it is connected to the LAN.

SSH (with putty for instance) to the pi. I have added the mac address in the router for a static IP. so I know how to connect with “ssh xbian@ipadres-of-pi” the default password is raspberry.

exit the menu and create local directories for the mounting points for your TV shows, movies, pictures and music.

I have made a dir named public on the root. which require root access so I had to sudo it.

xbian@xbian /public $ sudo mkdir Moives
xbian@xbian /public $ sudo mkdir Music
xbian@xbian /public $ sudo mkdir Pictures
xbian@xbian /public $ sudo mkdir TV

Next is to mount the network share and make it a permanent mount. So edit the /etc/fstab as root in your favorite texteditor. I used nano.

 

sudo nano /etc/fstab

 

The format to mount is: ip of network device:/path to share /local path  nfs so for my CH3Snas of conceptronic (which uses funplug) is:

192.168.1.133:/mnt/HD_a2/shared/Movies /public/Movies nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
192.168.1.133:/mnt/HD_a2/shared/Music /public/Music nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
192.168.1.133:/mnt/HD_a2/shared/Pictures /public/Pictures nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
192.168.1.133:/mnt/HD_a2/shared/TV\040Shows /public/TV nfs rsize=8192,wsize=8192,timeo=14,intr 0 0

 

After saving the file and rebooting the pi, it will be mounted. The next step is to configure the XBMC to see that the movies are on the local /public/movies folder.

 

Good luck and have fun with the Raspberry pi and Xbian (and XBMC)

Post on LinkedIn