Review – Raspberry Pi 7 inch HDMI HD 1024 * 600 Touch Screen

This is a review for this product from Banggood: Raspberry Pi 7 inch HDMI HD 1024 * 600 Touch Screen Module Kit With Housing Bracket

This is a great screen and stand overall, I’m pleased with the final results, it works great with my Raspberry Pi 3 as a fancy alarm clock.
Now the big hassle was putting it all together and setting it all up. That took me a long time due to the fact there’s no documentation for putting together the mount neither for the lcd driver parts.
I’ve attached some pictures of mine in case this helps people building theirs.
Packaging was fine, a little “light” for shipping a screen but… I didn’t notice anything broken yet.

Some things I noticed and thought I’d share, this may be useful to future buyers:
– The touchscreen driver ribbon (small one) can be put in any direction, this will just swap X and Y on the touchscreen, if that is the case, just invert the ribbon again. No damage done.
– Also that touchscreen driver ribbon needs to be placed properly into the other connector. The connector is a bit too big and so the ribbon can be placed too much to the left/right, make sure it’s centered! Otherwise you’ll get no touch input.
– For me, the Raspberry Pi 3 (debian jessie) needed to be upgraded using “rpi-update” to get the proper drivers for the touchscreen to work and wifi too (yes, odd…)
– For those not familiar with hooking up a screen ribbon, the connector for the main ribbon has 2 little latches on each side that need to be pulled out a bit before putting the ribbon in, then push them back in.
– The screen just lays on the stand, it can easily be knocked out of place, by your cat, your kid, your wife or your servant. Personally I put some Velcro horizontally at the top to keep it stable. It is pretty steady now and can be removed easily.
– The touchscreen sensor is actually 5-10 pixels smaller than the screen itself, so yeah you can’t touch corners…. : (
– The touchscreen is resistive, so only one finger is detected, and it can feel “weird” or hard to touch properly if you’re used to capacitive (newer) touchscreens. Though with a stylus it works quite well.
– No need to install the given drivers for the touchscreen driver on the latest Debian Jessie, just make sure your ribbon is properly placed in the middle of the plug (see my other comment), and that you ran xinput_calibrator properly (https://github.com/tias/xinput_calibrator) and saved your settings into /etc/X11/xorg.conf.d/99-calibration.conf.
– The screen itself can be used with pretty much any device (as long as it can do vga, hdmi or composite video) you won’t get the touchscreen part but it can be nice to have that option.
– There’s no dedicated spot to place a Raspberry Pi, but there’s a bit of room in the back so I may stick it in there.
– Screen image quality is a little on the blurry side, but I was expecting that. At a distance it’s fine, but being a techie I’d hate to use that as a tablet. There’s some sharpness settings, but that doesn’t change much. Color temperature is fine by default. Not too blue/yellow.
– Screen back is a little dirty/stained. It’s quite barebone and not ready for a typical end-user. For geeks its fine.

Overall I’d say it’s pretty good for the price, the stand is nice and sturdy.

IMG_-1178169905

IMG_20160416_161022_c

IMG_20160416_161000

IMG_20160416_160941

IMG_20160416_160359

――

Quickly install a new Drupal site (in a multisite environment) using Drush

Easy as that! Just replace with your own parameters!

drush site-install standard \
--site-name=FoobarSite \
--sites-subdir=foobar \
--db-su=adminuser \
--db-su-pw=adminuserpw \
--db-url=mysql://foobar:foobarpassword@localhost/foobar
――

How to add a Password reset link on user login block in Drupal

In Drupal 7, adding a link to allow users to reset their password (a “forgot my password” link) is quite easy through the hook_form_alter() hook.

/**
 * implements hook_form_alter().
 */
function mythemename_form_alter(&$form, &$form_state, $form_id)
{
  switch($form_id)
  {
    case 'user_login':
    case 'user_login_block':
      $form['links'] = array(
        array('#markup' => '<a href="/user/password/">Forgot your password?</a>'),
        '#weight' => 100,
      );
      break;
  }
}
――

Temperature Display with DHT22, VirtualWire and a LCD Shield on an Arduino Uno

The code below displays the temperature and humidity from a DHT22, but also receives that same data from another arduino or atmega through an RF Link using VirtualWire and displays it as well.

VirtualWire can be downloaded from:
airspayce.com/mikem/arduino/VirtualWire/index.html
DHT22 Library from Adafruit: github.com/adafruit/DHT-sensor-library
LCD Library and DFR Key from Linksprite: Linksprite Wiki

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
 
#include "DHT.h"
#include <LiquidCrystal.h>
#include "DFR_Key.h"
#include <VirtualWire.h>
 
// PIN 11 = RX
#define DHTPIN 12     // what pin we're connected to
#define LCD_BACKLIGHT_PIN         10  // D10 controls LCD backlight
//some example macros with friendly labels for LCD backlight/pin control, tested and can be swapped into the example code as you like
#define LCD_BACKLIGHT_OFF()     digitalWrite( LCD_BACKLIGHT_PIN, LOW )
#define LCD_BACKLIGHT_ON()      digitalWrite( LCD_BACKLIGHT_PIN, HIGH )
#define LCD_BACKLIGHT(state)    { if( state ){digitalWrite( LCD_BACKLIGHT_PIN, HIGH );}else{digitalWrite( LCD_BACKLIGHT_PIN, LOW );} }
 
// Uncomment whatever type you're using!
//#define DHTTYPE DHT11   // DHT 11 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
//#define DHTTYPE DHT21   // DHT 21 (AM2301)
 
 
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );
DFR_Key keypad;
 
DHT dht(DHTPIN, DHTTYPE);
 
int localKey = 0;
boolean displaycelsius = false;
boolean isstart = true;
boolean backlight = true;
boolean displayold = false;
float oldt = 0;
float oldh = 0;
float mint = 0;
float minh = 0;
float maxt = 0;
float maxh = 0;
float remt = 0;
float remh = 0;
float rempI = 0;
float rempM = 0;
float remt2 = 0;
 
float oldcelsius = false;
unsigned long previousMillis = 0;
long interval = 5000;
float h = 0;
float t = 0;
int displaymode = 4;
 
byte smiley[8] = {
  0b00000,
  0b00000,
  0b01010,
  0b00000,
  0b00000,
  0b10001,
  0b01110,
  0b00000
};
 
byte frownie[8] = {
  0b00000,
  0b00000,
  0b01010,
  0b00000,
  0b00000,
  0b00000,
  0b01110,
  0b10001
};
 
 
void setup() {
  Serial.begin(9600);
 
  // set up Receiver (first because it may set unused pins to wrong mode)
  vw_setup(2000);	 // Bits per sec
  vw_rx_start();       // Start the receiver PLL running
 
 
  // set up LCD  
  lcd.begin(16, 2);
  //Serial.println("DHTxx test!");
  lcd.print("Getting Temp!");
  dht.begin();
  keypad.setRate(10);
 
  digitalWrite( LCD_BACKLIGHT_PIN, HIGH );  //backlight control pin D3 is high (on)
  pinMode( LCD_BACKLIGHT_PIN, OUTPUT );     //D3 is an output
 
  // create a new character
  lcd.createChar(1, smiley);
  // create a new character
  lcd.createChar(2, frownie);
 
  LCD_BACKLIGHT(backlight);
 
 
}
 
void loop() {
 
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
 
  localKey = keypad.getKey();
  if (localKey == LEFT_KEY)
  {
    lcd.clear();
    displaymode = (displaymode + 1) % 6;
  }
  if (localKey == UP_KEY)
  {
    lcd.clear();
    //displayold = !displayold;
  }
  if (localKey == RIGHT_KEY)
  {
    backlight = !backlight;
    LCD_BACKLIGHT(backlight);
  }
 
  unsigned long currentMillis = millis();
 
  if(isstart || (currentMillis - previousMillis > interval)) {
    previousMillis = currentMillis;   
 
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
    h = dht.readHumidity();
    t = dht.readTemperature(!displaycelsius);
    /*LCD_BACKLIGHT_OFF();
    delay(200);
    LCD_BACKLIGHT_ON();*/
  }
 
  if(isstart || localKey == SELECT_KEY)
  {
    isstart = false;
    oldh = h;
    oldt = t;
    minh = h;
    mint = t;
    maxh = h;
    maxt = t;
    if(backlight)
    {
      LCD_BACKLIGHT_OFF();
      delay(200);
      LCD_BACKLIGHT_ON();
    }
  }
 
  minh = min(minh, h);
  mint = min(mint, t);
  maxh = max(maxh, h);
  maxt = max(maxt, t);
 
  lcd.setCursor( 0, 0 );
  // check if returns are valid, if they are NaN (not a number) then something went wrong!
  if (isnan(t) || isnan(h)) {
    //Serial.println("Failed to read from DHT");
    lcd.print("Sensor Error       ");
    lcd.setCursor( 0, 1 );
    lcd.print("                ");
  } else {
    if(displaymode == 0)
    {
      lcd.setCursor( 0, 0 );
      lcd.print("Temp.:  ");
      lcd.print(t,1);// Serial.print(t);
      lcd.print("F ");
      if((int)t>=68)
        lcd.write(1);
      else
        lcd.write(2);
 
      lcd.setCursor( 0, 1 );
      lcd.print("Humid.: ");
      lcd.print(h,1);// Serial.print(h);
      lcd.print("%");// Serial.print(" %\t");
    }
 
    if(displaymode == 1) // show saved temps
    {
      lcd.setCursor( 0, 0 );
      lcd.print("T: ");
      lcd.print(t,1);// Serial.print(t);
      lcd.print("F (");
      lcd.print(oldt,1);// Serial.print(h);
      lcd.print("F)");// Serial.print(" %\t");
 
      lcd.setCursor( 0, 1 );
      lcd.print("H: ");
      lcd.print(h,1);// Serial.print(h);
      lcd.print("% (");
      lcd.print(oldh,1);// Serial.print(h);
      lcd.print("%)");// Serial.print(" %\t");    
    }
 
    if(displaymode == 2) // show min/max temps
    {
      lcd.setCursor( 0, 0 );
      lcd.print("Max T: ");
      lcd.print(maxt,1);// Serial.print(t);
      lcd.print("F");
 
      lcd.setCursor( 0, 1 );
      lcd.print("Min T: ");
      lcd.print(mint,1);// Serial.print(t);
      lcd.print("F");
    }
 
    if(displaymode == 3) // show min/max humid
    {
      lcd.setCursor( 0, 0 );
      lcd.print("Max H: ");
      lcd.print(maxh,1);// Serial.print(h);
      lcd.print("%");
 
      lcd.setCursor( 0, 1 );
      lcd.print("Min H: ");
      lcd.print(minh,1);// Serial.print(h);
      lcd.print("%");
    }
 
    if(displaymode == 4) // show local and remote
    {
      lcd.setCursor( 0, 0 );
      lcd.print("LT:");
      lcd.print(t,1);// Serial.print(t);
      lcd.print(" LH:");
      lcd.print(h,1);// Serial.print(h);
      //lcd.print("F");// Serial.print(" %\t");
 
      lcd.setCursor( 0, 1 );
      lcd.print("RT:");
      lcd.print(remt,1);// Serial.print(h);
      lcd.print(" RH:");
      lcd.print(remh,1);// Serial.print(h);
      //lcd.print("");// Serial.print(" %\t");    
    }
 
    if(displaymode == 5) // show Remote
    {
      lcd.setCursor( 0, 0 );
      lcd.print("P:");
      lcd.print(rempI,1);// Serial.print(t);
      lcd.print("in ");
      lcd.print(rempM,1);// Serial.print(h);
      lcd.print("m");
      //lcd.print("F");// Serial.print(" %\t");
 
      lcd.setCursor( 0, 1 );
      lcd.print("T: ");
      lcd.print(remt,1);// Serial.print(h);
      lcd.print(" (");
      lcd.print(remt2,1);// Serial.print(h);
      lcd.print(")");
      //lcd.print("");// Serial.print(" %\t");    
    }
 
    /*if(!animfirst || localKey == SELECT_KEY)
    {
      animfirst = true;
      for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
        // scroll one position left:
        lcd.scrollDisplayRight(); 
        // wait a bit:
        //delay(150);
      }
 
      // scroll 29 positions (string length + display length) to the right
      // to move it offscreen right:
      for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
        // scroll one position right:
        lcd.scrollDisplayLeft(); 
        // wait a bit:
        delay(50);
      }
    }*/
 
 
  }
 
 
    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
	int i;
 
        digitalWrite(13, true); // Flash a light to show received good message
	// Message with a good checksum received, dump it.
	Serial.print("Got: ");
 
	for (i = 0; i < buflen; i++)
	{
	    Serial.print(buf[i], DEC);
	    Serial.print(" ");
	}
	Serial.println("");
        digitalWrite(13, false);
 
        if(buf[0] == 200)
        {
          remh = (float) buf[1] + ((float) buf[2]) / 100.0;
          remt = (float) buf[3] + ((float) buf[4]) / 100.0;
          rempI = (float) buf[6] + ((float) buf[7]) / 100.0;
          rempM = 100.0 * (float) buf[8] + (float) buf[9] + ((float) buf[10]) / 100.0;
          remt2 = (float) buf[11] + ((float) buf[12]) / 100.0;
        }
    }
 
  if(localKey != SAMPLE_WAIT)
    delay(200); // delay to avoid key getting registered multiple times.
}
――