Node.js and Mongoose: connection hanging on find()

Following this tutorial to build a simple REST api on Node.js with Express, attempting to retrieve all docs from my MongoDB gave these errors:

2016-05-19T20:10:47.311-0700 [initandlisten] connection accepted from 127.0.0.1:52053 #4 (2 connections now open)

2016-05-19T20:10:47.325-0700 [conn4]  authenticate db: nodetest { authenticate: 1, user: "", nonce: "xxx", key: "xxx" }

2016-05-19T20:10:47.336-0700 [conn4] Failed to authenticate @nodetest with mechanism MONGODB-CR: ProtocolError field missing/wrong type in received authenticate command

Some quick Googling turned up the same error in this post that just suggested authentication was failing because no user was passed. So created a new used with:

db.createUser({user : 'nodetest', pwd: 'passwordhere', roles: ['readWrite', 'nodetest']})

… and problem solved.

Update: onscreen keyboard for Raspberry Pi 7″ touchscreen

Quick followup from last week’s post on setting up an onscreen keyboard. I couldn’t find a way of getting an onscreen keyboard, either matchbox-keyboard or florence, to respond on Raspbian’s logon screen. Rather than spend more time on investigating this, I just enabled the logon to desktop in raspi-config, and now logged on, either of the keyboards work as expected, perfectly well.

Florence seems to be the better of the two I tried. Once opened from the menu you can drag it around, or minimize it to a keyboard icon, so you can pop-it open as needed.

If I could get it to work from the logon screen too that would be awesome, but avoiding that issue and once you get to the desktop, it works great.

In progress: Setting up an onscreen keyboard for the 7″ touchscreen on the Raspberry Pi

I just received one of these very cool 7″ touchscreens for the Raspberry Pi: https://www.raspberrypi.org/products/raspberry-pi-touch-display/

I have the default logon prompt when my Pi starts up, so first challenge is, how do you logon without a real keyboard attached, without having to disable the logon? There are a number of onscreen keyboards available – based on this thread I installed florence:

sudo apt-get install florence

and then edited /etc/lightdm/lightdm-gtk-greeter.conf adding ~a11y; for the Accessibility icon on the logon screen, and keyboard=florence so it appears in the menu.

The keyboard now appears, but as soon as I press a key it disappears. From this thread, installing at-spi2-core appears to fix the issue:

sudo apt-get install at-spi2-core

This seems to fix the keybaord not disappearing, but not having any luck getting characters to appear in the username/password fields. Still some investigation to do on this one.

Booting Raspbian Jessie to a shell prompt

Raspbian Wheezy on the Raspberry Pi used to boot to a shell by default, but on Jessie, the default is to boot in graphical mode to the desktop. You can easily change this with raspi-config, either from the desktop menu using the gui app or raspi-config from the command line. Step by step instructions in this post.