#RaspberryPi – setup without monitor: enable VNC

Buy Me A Coffee

Hi!

In my previous post I shared a series of steps to:

  • Configure and SD Card with Raspbian
  • Automatically connect to a WiFi network
  • Enable SSH
  • Expand the file system
  • Rename the device
  • Update the default Raspbian software

In this post I’ll share the necessary steps to enable the VNC service, so you can connect to the Raspbian Desktop via VNC.

Enable VNC

In order to activate the VNC service we need to access to the device configuration with the command

sudo raspi-config

Then we select the options

  • Interfacing Options
  • VNC

Select YES

And that’s it, the VNC Server is enabled.

Now we can connect to the device with a VNC client app. Like in example, VNC Viewer

Conclusion

And that’s it, we have our device updated and running with the latest software versions and we didn’t use a monitor! I’ll update this post frequently to make it relevant with my personal best practices.

Happy coding!

Greetings

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#RaspberryPi – 1st setup without monitor: auto connect to WiFi, enable SSH, rename, update and more!

Buy Me A Coffee

Hi!

Ok, let’s assume you did the tutorial and installed the latest raspbian image in an SD card. If you want to access and control remotely your device you may want to follow this steps.

Configure Wireless connection

In the SD Card, you need to create a file named [wpa_supplicant.conf] in the root of the SD card with the following information:

country=ca
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
 scan_ssid=1
 ssid=" Your WiFi SSID"
 psk="You amazing password"
}

The file content is very straight forward to understand. Main values to complete are [ssid] and [psk].

Once you put the SD card in the device and start the device, it will automatically connect to the configured WiFi.

Enable SSH

If you also want to enable SSH, you need to create a blank file named [ssh] to the main partition.

Once you put the SD card in the device and start the device, it will automatically enable the SSH service.

Find the IP address in your network

And that’s it, your Raspberry Pi will be connected to the Wifi and with SSH enabled. At this moment we can use a tool like AngryIp (see references) to detect the new device in the network

My new device IP is: 192.168.1.246

Access via SSH

I used to like Putty to connect to my device, however during the past months I’ve been using Windows Terminal and Powershell. In order to access the device I need to execute the command

ssh user@deviceaddress

and my data is

  • user: pi
  • ip: 192.168.1.246
  • password: raspberry

You can now start working with your Raspberry Pi !

Change Password

The default password for the device is “raspberry”, and as usual, it’s recommended to change it. In order to do this, in the ssh terminal, let’s access to the device configuration

sudo raspi-config

This will open the configuration for the device.

Option number 1 will allow us to change the password.

Rename the device

In the same Raspberry configuration tool, we can rename the hostname that our device will use for network operations.

Select the options

  • Network Options
  • Hostname

And define the new name for the Raspberry Pi device.

Expand FileSystem

Another important option in the configuration is to expand the SD disk.In the same configuration screen, select

  • 7. Advanced Options
  • Expand File System

Now we need to reboot and after the reboot the file system should have been expanded to include all available space on your micro-SD card. Reboot with the command

sudo reboot

Update the device

Of course, at this moment you should change your default password and update everything with a command like this one

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'

Conclusion

And that’s it, we have our device updated and running with the latest software versions and we didn’t use a monitor! I’ll update this post frequently to make it relevant with my personal best practices.

Happy coding!

Greetings

El Bruno

References

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#Flow – Using configuration information from an App using #OneDrive, #Excel, Microsoft Flow and HTTP Requests

 

Hi!

It is no news that Developers and Business Users speak different languages. This is why, sometimes when I ask a business User to update a configuration file, it usually does not ends well. It happened to me when sharing [.json], [.config], or [.xml] files,
these users do not know which tool to use to edit the values, and also happens that a plain text format, is often not intuitive for them.

That’s why a while ago, I took a different approach: I decided to adapt myself to their tools and ways to work. In a nutshell the working model with these files is as follows

 

  • Business Users: Microsoft Excel
  • Developers: Json

And as we are in a time where [Serverless] is the premise, I challenged myself to see if I could do it without writing a single line of code. To do this, use Microsoft Flow as the base integrating information store in OneDrive with Excel files and interacting with the flow using HTTP requests.

The first thing was to create a spreadsheet with information to share, in this case a list of users, email accounts and twitter.

I1

The, I saved the file in OneDrive and I grant access to the file to my Business Users. They can happily edit the file now.

I2

And then I created a Flow to access to this configuration file but in a developer mode. The Flow is using an HTTP Request as the trigger, then it reads the information from the Excel file and it closes with an standard HTTP Response including the content of the Excel file in Json format.

I3

There is only one tricky step here, and is when we need to build the Json response. To do this, I use a simple Flow Expression working with the main body of the Excel file.

I4

When we save the Flow, we can access to the public URL where the flow is published. This is the URL we can use in our Apps to access to this information. To test this without a full .Net App, we can use Postman (I wrote about this some time ago). 1 Url copy and 2 clicks later, and we can see the HTTP response with the configuration information in Json..

I5

As soon as Flow uses this Excel file, we will see a new column in the excel file [__PowerAppsId__]. We should not  delete this column. The easy way to explain this is: Flow uses this column as base to check where / when a file was accessed and to see the changes on this.

However we can add more information to the file, and if we want, an extra column with new information, in example:

I6

As soon as the changes are reflected and stored in OneDrive, a new request to our Flow will return a new complete Json response with the new column and the new rows.

I7

As a ZERO CODE solution, this rocks! and it rocks twice if you also gives your users the chance to use Excel as a edition tool for this.

Happy Coding!

Greetings @ Toronto

El Bruno

References

Tools

My posts on Logic Apps

My posts on Flow

 

#Flow – Manejando información de configuración de Apps con #OneDrive, #Excel, Microsoft Flow y peticiones HTTP

 

Hola!

No es ninguna novedad que los developers y los usuarios de negocios hablamos lenguajes diferentes. Es por esto, que en algunas ocasiones pedir a un usuario de negocio que actualice un archivo de configuración puede no ser una buena idea. Me ha sucedido que al compartir archivos [.json], [.config] o [.xml], estos usuarios no saben que herramienta utilizar para editar los valores, y también sucede que un formato de texto plano, suele no ser intuitivo para ellos.

Es por eso que hace un tiempo, tomé un enfoque diferente: decidí adaptarme a sus herramientas. En pocas palabras el modelo de trabajo con estos archivos es el siguiente

  • Business Users: Microsoft Excel
  • Developers: Json

Y como estamos en una época donde [Serverless] es la premisa, me desafié a mí mismo, para ver si podía hacerlo sin tocar una línea de código. Para esto utilice como base Microsoft Flow integrando los servicios de OneDrive, Excel e interactuando con peticiones HTTP.

Lo primero fue crear una hoja de cálculo con información a compartir, en este caso un listado de usuarios, cuentas de email y twitter.

I1

Luego almacene el archivo de Excel en OneDrive y compartir acceso con el usuario de Negocio que la editara.

I2

El Flow para consultar la información, se dispara con una petición HTTP Request, luego se lee la información de Excel desde OneDrive y se retorna la misma en una HTTP Response.

I3

El único paso donde se requiere una configuración especial es en la creación del Response, ya que utilizo una Expression del tipo String para crear el response con la información completa de las filas de Excel.

I4

Pues bien, al guardar el Flow, el mismo crea la Url donde podemos invocar al mismo. Como explique en un post anterior, podemos utilizar Postman para probar este tipo de Flows, en este caso un simple HTTP POST Request y ya tenemos nuestra información en formato Json.

I5

A partir de ahora, en nuestra hoja Excel ahora veremos una nueva columna llamada [__PowerAppsId__] que es la que utiliza Flow para tener un Track de los accesos y el trabajo con esta hoja de cálculo. Es importante explicar a nuestros usuarios que esta columna no debe ser modificada. Si por ejemplo agregamos una nueva columna y más información al archivo Excel podremos ver algo similar a la siguiente imagen.

I6

Si realizamos una nueva petición, podremos ver que el Response incluye los nuevos campos y los nuevos registros.

I7

Pues bien, como solución ZERO CODE para compartir y editar información de con usuarios de negocios, me parece que esto es suficiente.

Happy Coding!

Saludos @ Toronto

El Bruno

References

Tools

My posts on Logic Apps

My posts on Flow

 

#Hololens – Now you can work with Visual Studio tools for #Unity3D and #VS2017

Hello!

Every couple of months, I’ve had to reinstall my development environment from scratch. This time was not a software problem, this one was raised by hardware issue: my 2nd disc died (and I lost some of my not backup / sync information). As if it were a coincidence, I’ve taken advantage of an offer of Black Friday, Pink Saturday or something like that, and I have bought a 2 TB disk quite interesting (link). This leaves me with a

So let’s put a smile and see the bright side on this. I take advantage of an offer during Black Friday, Pink Saturday or something like that. I have bought a 2 TB 2.5” internal disk with some very amazing features. So now I have a happy  development environment again:

  • 500GB SSD main drive
  • 2 TB as secondary drive

clipboard01

Now, because I started from zero (again) I decided to try to work purely and exclusively with Visual Studio 2017 RC. One of the first things I’ve noticed is Visual Studio Tools for Unity3D were available only for Visual Studio 2015. This meant a serious impediment, VSTU are part of the development of Hololens VS + Unity.

Fortunately, the latest version published today in Visual Studio Tools for Unity, supports Visual Studio 2017 in Beta (3.0) mode.

clipboard03

It won’t work smooth from scratch, you need to perform some additional steps so everything works fine, for example:

  • In Unity, access the menu “Edit / Preferences”
  • Select [External Tools / External Script Editor]
  • In the combo choices we see MonoDevelop, Visual Studio 2015 and Browse.
  • Select Browse and select the path of the executable for Visual Studio 2017 [“%\Program Files\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe”]

At this time we will see VS2017 RC as the selected option and we can start to work with this IDE

clipboard05

Here we see the instance of Visual Studio 2017, in mode debugging from which we can attacharnos at one instance of Unity and debug against the same.

clipboard07

Now if we can forget about Visual Studio 2015 and follow created apps with Unity3D and Visual Studio 2107 Hololens RC!

Greetings @ Toronto

El Bruno

References