How to connect/update Raspberry Pi to Mender demo server

Hi,

I downloaded and installed the ready for use Raspbian Image from here ( Raspberry Pi 3 Model B/B+ Raspbian images): https://d1b0l86ne08fsf.cloudfront.net/raspbian-images/2019-04-08-raspbian-stretch-lite-mender.zip

Then I installed Mender demo server following the instructions from here: [https://docs.mender.io/2.0/getting-started/create-a-test-environment](http://Install a Mender demo server)

In Raspberry device (client) I changed the server IP to be installed Mender demo server 192.168.88.50

When I check the status using “sudo systemctl status mender”, I have: level=error msg=“authorization request error: dial tcp 192.168.88.50:443: connect: connection refused” module=“client_auth”

The configuration file /etc/mender/mender.conf is:
{
“InventoryPollIntervalSeconds”: 5,
“RetryPollIntervalSeconds”: 30,
“ServerURL”: “https://hosted.mender.io”,
“TenantToken”: “Paste your Hosted Mender token here”,
“UpdatePollIntervalSeconds”: 5,
“RootfsPartA”: “/dev/mmcblk0p2”,
“RootfsPartB”: “/dev/mmcblk0p3”
}

My questions are:

  1. How to generate TenantToken manually?
  2. What is necessary to setup on the client?
  3. What is necessary to setup on the server?

If you intend to use the Mender demo server you don’t need a tenant token. Look on the Mender hub page for the text “If you want to use a self-hosted Mender server, use the --server-uri option to mender-artifact below instead of --tenant-token.” Give that a shot. If those instructions are unclear, we would love if you can suggest how to make it clearer.

Thanks. Currently, this is Proof of Concept (PoC) and Mender demo server is OK.
For production we will use “self-hosted Mender server”, so I will need of some instructions for that case.

The urgent is how to make connection. It is not clear for me how to use the --server-uri option to mender-artifact. Can you clarify step by step for client part and server part?

You can get mender-artifact usage help with -h flag, try these:

./mender-artifact -h
./mender-artifact modify -h

Keep in mind that modifying artifacts with mender-artifact is currently a slow process, see https://hub.mender.io/t/mender-artifact-hangs/752/4

In any case, this is one of many ways (as you’ll see later) that different Mender apps propose to accomplish one basic task - changing /etc/mender/mender.conf file.
So the easiest way for POC is to modify this file manually after checking it’s format in docs.

Hi,
Is mender-artifact to modify Image, that is not already installed on the device?
I have already installed this Image of Raspberry Pi. What is the ability to make changes there?
Do I need to make changes to the server?
From this documentation, I do not know what to do and how to do it. Can you give an working example?

If you already have a RPI with mender running, just edit /etc/mender/mender.conf on the device (connecting the keyboard and monitor, or via ssh, or via insering sd card in your pc) and restart mender.service or simply reboot!

sudo journalctl -f -u mender will help you debug what’s going on with the client.

I personally never tried demo server and directly installed a prod instance which is fairly easy considering you have a VPS available. I was able to find all required information it the docs. Yet information is rather distributed through the docs, so I suggest to read it through completely first.

And don’t forget about troubleshooting section :slight_smile:

You need to provide the IP address of your server in your /etc/hosts file using the domain name of docker.mender.io and s3.docker.mender.io. With the demo server, you are using a prebuilt certificate that is generated against those domain names so just add a hosts file entry on your target to map that to the actual IP address. You can see how we do it with Yocto here: https://github.com/mendersoftware/meta-mender/blob/master/meta-mender-demo/recipes-core/netbase/netbase_%.bbappend

Note that if you don’t modify the artifact directly (ie before it’s installed on hardware), then when you deploy OTA, the new image won’t have that change and connections to the server will fail, so you likely want to do both.

Hi drewmoseley,
Deploy the same program, mender server will display
“Already installed”, I want to ask if it is LOG to let my device know that it is the latest program

Thanks!

Mender will not attempt to install an artifact on a system that is already running that particular artifact. You will need to provide a different name if you want it to install.

Drew