donderdag 11 november 2021

Experimenting with Node-Red coding on a Raspberry Pi

Trying some coding  on a raspberry pi with a sense hat using node-red.

The environment variables(temperature, humidity and pressure) are shown on the node red dashboard in the background and streaming on the sense hat display.

I used these data 4 years ago to build a weather station using MySQL and R; here are the links:




woensdag 3 november 2021

Flying around (4)….Hacking the Tello

Tello creates its own based WiFi network. It uses 2.4 Ghz and UDP as protocol to communicate with a client over ports 8889 at the server and 8890 at the client.

Let’s first look at the WiFi. When you directly connect from your cellphone no security protocol is used; just an open WiFi connection between server and the client 192,168.10.2(phone).


* TELLO-627F4A Infra 4 54 Mbit/s 95 ▂▄▆█ --

If you create a password, an option in the settings of the app, WPA2 is used as the security protocol.


TELLO-TELLO-627F4A Infra 4 54 Mbit/s 100 ▂▄▆█ WPA2

You can remove the password by holding the start button for 10 sec. Tello will completely reset. 

Tello is equipped with SDK: software development kit. The Tello SDK 2.0 user guide gives an overview of programming commands. Download here:

Packet Sender

Is it possible to send SDK commands directly to the Tello?

When a computer is directly connected to the Tello network, you could give commands directly to to the Tello. Install ‘Packet Sender’ and send UDP packages to the Tello on address 8889. Tello will reply with OK.

Here is a screenshot showing battery, takeoff and land.

How about connecting the Tello to you home network with WiFi? Yes that is possible, then Tello is not an access point anymore but a client to the home WiFi network.More on this:

Home Network

Adding Tello to the home network:

Run the following python script: python -s [SSID] -p [PASSWORD]

Here is the response:

sending cmd command

from ('', 8889): b'ok'

sending cmd ap [SSID] [PSW]

from ('', 8889): b'OK,drone will reboot in 3s'

Now Tello is a client of you home network, and directly connecting to the Tello from the phone app is not possible anymore.

Next: We have to scan the network for the IP number of the Tello

nmap -sP or nmap -sT

Nmap scan report for _gateway (

Host is up (0.0080s latency).

Nmap scan report for

Host is up (0.015s latency).

Nmap scan report for

Host is up (0.081s latency).

Nmap scan report for

Host is up (0.034s latency).

Nmap scan report for

Host is up (0.035s latency).

The last one was newly added to the home network.

Ping on that address:

peter@Pegasus:~/Desktop/TELLO$ ping

PING ( 56(84) bytes of data.

64 bytes from icmp_seq=1 ttl=255 time=1.33 ms

We could check the connection by sending UDP packages with packet sender.

Or run python scripts to control a flight or a mission of  the Tello. But in the scripts you have to update/change the IP address of the Tello and the ID. Send sn? with packet sender to get the ID.

From the oneoffcoder site – – try the following scripts. and demo_status were working. Don’t forget to update the IP number and ID when connected to local wifi network.

You can also create a complete mission and save taht in a .txt file.

Then run:

python -f cmds-01.txt

See also my blog posting Flying Around(3).
Java Script

Not only Python but also JavaScript is possibility to control Tello from the command line.

But you have to install the environment to to load a JavaScript for execution. I used the Snapstore and searched for npm to install node.js.

The following GitHub repository has a few scripts to get started:

You can run for example:

node TelloCommandLine.js

this invites you to send commands to the drone

Tello Command Console


Tello> Enter a Tello SDK Command.

Tello> command

Command: command

Data received from server : ok

Tello> takeoff

Command: takeoff

Data received from server : ok

Tello> land

Command: land

Data received from server : ok

Tello> command

Command: command

Data received from server : ok

Tello> takeoff

Command: takeoff

(If the port is already in use; run sudo pkill -9 node)


A special case for controlling Tello with JavaScript is Node-Red. Here is the GitHub repository:

What exactly is Node-RED?

Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.

Node-RED allows you to create functionality by wiring together flows of data between nodes using a browser. And it has gained tremendous popularity in the IoT space, by modeling bits of application functionality between IoT devices like sensors, cameras, and wireless routers.

Node Red is developed by IBM and is block based coding in a browser. After deploying the code you can have the results. Here are two pictures that show the basics: left the block coding and right the result after deploying.

A desktop or laptop is not great fun for controlling the Tello. Node_red can also be installed on an android device, like a phone or tablet. A complete install is possible, but a bit complicated because you have to set up Termux on your phone/tablet.

For installing Termux, see also

After installing Termux is here the recipe for installing node red:

Much easier is to install an app RedMobile Lite – Node -RED on Android.

Node Red is especially interesting for IoT, internet of things, connecting devices and data streams. Connecting Tello with Amazon Alexa is an example. Here is the code: . After installing you will be able to control Tello with voice commands.

woensdag 20 oktober 2021


 When you buy a Tello EDU you have 4 mission pads, which enable the drone to fly special assignments. To fly a mission there are special command available. Look at the Mission Pad User Guide. Available at :

However flying a mission was more complicated. I had 3 problems:

1. the mission pad numbers

2. set up a mission from the command line

3. X and Y coordinates

First problem: pad numbers MID mission pad ID

It seems the pads have numbers, but I could not find where that number was. How can you find out?

Go to github: . Here you find a bonus script :

If you run that script and tello is on a pad it will give you the mid.

Here is the output when Tello flying over MID 1:

'agx': -6.0,

'agy': 10.0,

'agz': -999.0,

'baro': 112.27,

'bat': 61,

'h': 70,

'mid': 1,

'mpry': '2,-4,178',

'pitch': 0,

'roll': 0,

'temph': 47,

'templ': 44,

'time': 12,

'tof': 83,

'vgx': 0,

'vgy': 0,

'vgz': 0,

'x': -10,

'y': 3,

'yaw': -1,

'z': 84}

Do that for all 4 pads front and backside and write the number on the pad.

Just discovered that the number is on the pad: printed as white line between the stars! If you look closely it is a number. Here is for example pad 3:

Second: how to set up a mission with 4 pads.

The mission pad works as a switch; like if…. Then. Read the guide closely.

Set up the following:

M1 M2 M3 M4 are the MIDs

The arrow is the direction, represented by the direction of the rocket on the pad. ( I come back to this later)

Next we need a command line to send instruction to the Tello.

Go to . Under section 8 you find the scripts to send commands to the Tello.

For example:

python3 -f command4.txt

In this case the commands in the txt file command4 are send to the drone.

And here are the commands for command4 forcing the Tello to fly a square over the pads.

(Important to understand is that you have to state the x,y,z coordinates of each MID)





mdirection 0

jump 0 80 60 60 90 m1 m2

#(tello is on m1 flies to 0 80 60, speed 60, if m2 is recognized camera is turned 90 degrees)


jump 0 80 60 60 90 m2 m3

delay 1

jump 0 80 60 60 90 m3 m4

delay 1

jump 0 80 60 60 90 m4 m1

delay 1


And the result is this video:

Problem 3:  X and Y

The coordinates are looking peculiar; I just discovered them by trial and error. But when I changed the direction of the pads(direction of the rocket) it did not work anymore. I needed new coordinates.

So the coordinates (x,y; that is the first two) are relatives to direction. The rocket gives the direction of the X axis.

Here are two figures showing the relations ship between direction and coordinates.

Figure 2 shows the position of the Tello: using the the same x and y while turning the direction of the pad.

Figure  1 shows the position of the Tello: using different x and y , while keep the pad in the same direction. 

Do you want to fly over the diagonals. Keep the pads in the same position when flying in a square over the pads. For the diagonal flight use the following: 

mdirection 0
jump 80 80 60 60 90 m1 m3
jump 0 80 60 60 90 m3 m4
delay 1
jump 80 80 60 60 90 m4 m2

woensdag 13 oktober 2021

Off the Charts The best of our data journalism Economist Data journalism News Letter(2)

 Why “Python” is the best coding language for data journalism

By  Dolly Setton Data Journalists
From the Economist Data Journalism  newsletter

Most data journalists would agree that coding has become a core component for good data journalism. But few can agree which programming language is best for it—is it “R” or “Python”? Last week, one of my colleagues explained why they think R is the superior language for data journalism. This week, I will explain why I prefer Python.

Python is, like R, an open-source language so it is free for anyone to use. Unlike R, it is a full-fledged, general-purpose language and an integral part of digital life. It powers popular tools and platforms such as Google Search, Spotify, Instagram and YouTube. Guido Van Rossum, a Dutch developer, released the first version of Python in 1991.

vrijdag 8 oktober 2021

Off the Charts The best of our data journalism Economist Data journalism News Letter

 Why “R” is the best coding language for data journalism

By  James Fransham Data Journalists
From the Economist Data Journalism  newsletter

Data journalism is a pursuit whose success relies on being able to crunch numbers. Lots of them. For many years data journalism—a term that was popularised beginning about 2010—mostly relied on the power of spreadsheets alone. But pivot tables, vlookups and other spreadsheet functions only get you so far. With more and more data available, being able to perform more powerful and flexible operations is now a vital part of the data journalist’s toolkit. Two programming languages, Python and R, vie for data journalism supremacy. But which is best? Here is my case for the latter. 

R is an open-source language, it is free and open for use by everyone. It was spun out of another programming language called “S” in the early 1990s by two academics working at the University of Auckland in New Zealand. It was developed to focus on statistical-based problems and so it naturally handles data.

zondag 3 oktober 2021

FLYTING AROUND( 2): programming the Tello

The Tello has a dedicated app for children. Go to the app store and download Tello Edu. It works better, because of the screen size, when the app is installed on a tablet.  First you have access to the remote control on screen (1), which works the same as on a cell phone. But there is also an option called blocks. Here you can practice the programming. First in a virtual environment(2), and then in real time.

It is very easy to learn. Children will get the idea behind programming fast and it is fun!


Tello is equipped with SDK: software development kit. The tello sdk 2.0 user guide gives an overview of programming command. Download here:

zaterdag 2 oktober 2021


I had never any interest in computer games. Long time ago my attention was drawn to a drone, for reporting purposes. I wrote a story about the possibilities of drone reporting; here it is: News that fFies: . I did not practice myself. Drones were large and expensive. However, after more than 10 years a lot has happened. I was impressed by the Tello drone. For less than 100$ you can buy one at for example Amazon:

This Ryze Tech Tello - Mini Drone Quadcopter is an impressive toy. Less than 30 grams, flies around 15 minutes, with a build in camera for pictures and video, remote control using an app on your mobile phone, and last but not least it is programmable with Python and JavaScript. Of course it is more a toy for fun, than a professional piece of equipment. With this small weight, flying outside is only possible under favorable weather conditions. Nevertheless you can learn how to fly a drone.

woensdag 29 september 2021

Can the German Parliament work magic? From 703 to 735 seats!

Germany is important not only because it is our biggest neighbor, but it plays an important role in the European Union as well. Therefore the outcome of the elections is important. The turnout of the latest elections for a new Bundestag was published by most media. I was impressed by the data journalism approach of the Economist.

Here is a copy of one of the visualizations in the article.

woensdag 18 augustus 2021

Columbia Journalism project Workbench closing


Workbench ( the data journalism platform with built-in training; a project of Columbia Journalism School will close Oct 15. The project started in 2018 and is offering interesting tools and examples for data journalist. Pierre Conti, Co-founder and CEO writes: “ we did not succeed in creating enough revenue to make Workbench sustainable. Funding for journalism technology is scarce, and we did not manage to attract enough paid users to build a healthy business”. That is a pity of course, but you can build your own workbench running from you own machine. See instructions: .

woensdag 21 juli 2021

Is Windows transforming into Linux?

My first machine was running MSDOS is operating system(OS). On top of it you run a simple word processor, spreadsheets and database  software. It worked but a graphical user interface(GUI) was still under development. Things got slightly better with the introduction of Windows; Windows 95 was the big take-off. And of course adding to the OS the Office software: Windows became the tool of preference. Although Windows software was installed on  90% of the PC's., it was generally no fun. 

For example, you could get a blue screen or a completely frozen screen. You had to restart and if you did not saved your work you could start all over. Then the was the continuous updating by Microsoft; sometimes in the middle of your work. In the middle of a training Bill Gates stepped in to make things better.  And finally after all the updates, you had to find out where you could changed settings, the designers had changed the position and placed them under new headings.


Finding an alternative OS was in the beginning not easy and demanded skill and knowledge of Linux. But Linux adapted fast and developed  a complete OS with different tools. There was a cold war between Microsoft and Linux. Microsoft CEO Steve Ballmer described Linux at that time as “cancer ”. Although Linux was developing in the direction of a serious alternative for Microsoft., and with no cost: Linux is open source and therefore free. It was never accepted. Running and installing Ubuntu or Mint is not rocket science, and working on these machines is slightly different from a windows machine. It never convinced Microsoft die hearts.

Microsoft may have won the battle for desktops and office software, but the servers and network software is all Linux. So the problem is to enable Windows to talk to all the Linux machines. Finally Microsoft saw the light and start embracing Linux.

Azure, Microsoft successful cloud computing is running Linux. So Microsoft needed it own  Linux version. Secondly this Linux version should also work on Windows machines. Let’s have a look at the various options.

 Linux on Windows

1. Installing Linux on windows is called WSL- Windows Subsystem Linux.The WSL comes in three  steps. Microsoft first introduced a Linux terminal in a distribution of choice, for example Ubuntu. Later it introduced a GUI, so you can run linux apps wit GUI.WSL1 only Linux terminal. Here is the documentation of Microsoft or read my blog posting in 2016. 

2. Later Microsoft introduced WSL2  with a GUI  using Xserver. If you want to give it try, here is a nice video showing how to install. Running Linux inside Windows is one thing; but it works also the other way. From Linux you have access to Window files and programs. Type for example explorer.exe at the Ubuntu prompt and you have the file explorer show the directory you in.

3. The latest is WSLg the GUI for Linux in Windows and it makes it possible to run directly Linux graphical apps. But you need to registers for the insider program and install windows developer version. It is to be expected that in fall with a new windows update WSLg will be implemented. 

Microsoft Linux

Microsoft own Linux version-CBL(Common Based Linux-Mariner). To install Microsoft Linux you can download the distribution and transform it into an ISO. To the get the feeling run it in a virtual machine. It comes  not with desktop and  GUI. CBL-Mariner is the Linux kernel used for running other Linux distributions

What is next?

Yes the cold war is over and peace broke out between Microsoft and Linux. Microsoft is definitely embracing Linux and incorporating it in windows. And also Microsoft is heavily involved in the development of open source software since it acquired Github. But it is not to be expected that Windows will be replaced by Linux. There is too much invested in other related Windows software to start a transition like this. But as a user you could run smoothly Linux apps.

However, now I have a Microsoft Linux distribution (CBL-Mariner) and I can run Linux apps graphical in Windows, and start Windows apps from the Linux prompt. Nice but so what…. ? I am not a developer. And as  user I prefer to run either Linux app or Windows apps, avoiding not the get mixed up. At the end of the day it is still running Linux in Windows in container. For the moment I stick to Linux(Ubuntu or Mint), which both give the ultimate control over the machines and the installed software.


donderdag 15 juli 2021


Version 1.0

Analyzing and visualizing a table with figures for an article in a newspaper is not exceptional anymore. Take for example local taxes per municipality. Once you have downloaded the figures in a spreadsheet is not so difficult to to notice which of the local taxes generates the highest income for municipalities. A simple bar graph will do; or platting the tax income per municipality on a map will draw attention to the most expensive municipalities. Her are two examples made by Flourish about taxation for garbage collection in municipalities in the province of Gelderland. A bar graph: and a map: . Her is a dashboard made in Tableau:

Sometimes the data provider makes downloading data easy ( ), bit often also provides analysis and visualisation( ).

Here is the reporting of a local/regional newspaper about the taxes:

This is data journalism 1.0 and it is not the rocket science anymore it looked like 25 years ago. Data journalism 1.0 is almost 25 years old and the original beta version .0 is more tha 50 year old.( ) A lot has been changed, most important is the tools are more easy to handle and require less skill and training. Data from a web page for example can directly imported in excel for example and visualizing based on a template from Flourish for example is almost standard procedure for journalists.

Version 2.0

On the other hand data software is developing fast. Data science is creating more software for analyzing data. Interesting for application in journalism is software generally known as Artificial Intelligence(AI) or Machine Learning(ML). You don’t need special machines for running those software, nor do you have to pay huge amounts for the use. A good laptop with a fast processor enough memory and a nice video device will do to run the software,which comes in two favors: R or Python. Skipping the discussion which is best, the difference in general is that both are capable of analyzing data; Python is a full programming language and R is more focused on statistics. I work mostly with R ( ), running on a Linux operating system(OS)( ). But Windows or Apple will also work.

R has a steep learning curve. Here is a howto start: There is no graphical user interface(GUI), so you work from a terminal typing in commands or merge a set of command  into a small program. R has libraries for special job, and one set of libraries is dedicated to ML AI and or ML has lots of application.

Here is an example analyzing a dateset of municipalities in NL . I will use this data set also for explaining Machine learning. This example shows a standard analysis of the data in R;

This example is shown in Kaggle; more about this interface:

Machine Learning

ML has for data journalism has various area’s for implementation or application:

Automated content production or robot journalism ( ) is one of them which drawing at the moment much attention. Another area is content optimalization: optimizing the content for a specific user.

For data journalism the second area data mining is the most interesting. The following chart gives an overview of the possibilities:

((chart from: )

I will not discuss all these programs in detail.

First I will discuss the basic idea of machine learning and second I will show some examples. On data set based on data about dutch municipalities I will use to show: linear regression; decision trees and neural networks. An other dataset based on twitter I will use for showing K means.

The core of AI or ML is a black box: you give the box data input, next the box starts doing complicated statistical operations (the algorithm), which you fine tune with various option, and finally you have the output. Take for example the Titanic, there is complete data set about the passengers. With ML it is possible to calculate your changes to survive the shipwreck. Or to predict whether the mayor of a dutch municipality will be male or female.

For using the Ml you don’t need exact knowledge about the black box, the algorithm itself. That is for the coders or data scientist how design this software. The basic question for your research is what do you want to do?

From the chart we see that there are two entries: supervised and unsupervised learning. Supervised learning means that model(algorithm) which predicts the gender of the mayor of the changes on survival, must be trained on a known data set. When the model is trained, and you know then the margins of error, it can be apllied to complete data set to the predictions.

In unsupervised learning the data is immediately read into the an algorithm which makes the best of it. For example, analyzing tweets from two populist members of the Dutch house of representatives (Wilders and Baudet) show that their tweets have different clusters. Meaning they are both right wing populist but focus on different issues. Creating the clusters is a mathematical operation with no control data.

Under supervised learning we have to areas: classification and regression.

Unsupervised learning focuses on clustering.

Examples of machine learning

0. Kaggle

I will use Google Kaggle interface to show the code of the various algorithms. Here is a general intro to kaggle.

- machine learning in kaggle:

1. Regression means that in a simple case with two variables, the variation of one variable is related to the variation and the other variable. Average income in a city for example will relate to the average price of houses; the relative rich cities houses will be more expensive. This relationship between the variables based on the variation they have in common can be expressed in a number: correlation. Or by a line a in scatter diagram, that is linear model, commonly called the trend(line)

When the number of variables increases the prediction of the outcome of one variable becomes more complicated. An the we have to use an other algorithm or model for the prediction. With decision trees it is possible to predict the gender of a mayor based om population, income, house price and unemployment; or predict the political party of the mayor based on the same variables. Here the predicted outcome is a category, nominal level of measurement

Neural networks make it possible to estimate the value, the quantity of a variable, ratio level of measurement. For example an estimation of the income of city, based on the other variables.

- regression: decision trees - random forrest:

- regression: decision trees with rpart:

- regression: neural networks with tensor flow:

2. Clustering

The goal of clustering is to group or cluster observations that have similar characteristics, This is an example of unsupervised learning, so we have no control or check. Inspection of the output is the test. In the example below we regroup municipalities.

- clustering:

3. Classification- classification with voyant using nearest neighbor :


More background and detail on machine learning for data journalists:

and )

and review of Automating the News. How Algorithms Are Rewriting the Media. By Nicholas Diakopoulos

  1. ISBN 9780674976986 ; Harvard University Press 2019