Arduino Access Denied Ubuntu

Ubutnu Arduino 1.6.8
Resolve error: Arduino /dev/ttyACM0 : Permission denied error. Works on Ubuntu 14.04 15.04, Mint , Debian

  • You need to add your user account to the linux group: dialout
  •  After your in the group you need add permissions use the /dev/ttyUSB0
  •  Reboot –
  • After reboot open Arduino 1.6 and upload your new program – CHEERS

 

arduino__Permission_denied

arduino__Permission_denied

HOW TO:

Open a Terminal window find out the user you need to add

Take note of the user name from the whoami command
 
whoami 

Take note of the user name from the whoami command that is the user you need to add to the group dialout

sudo adduser UserFromWhoAmiCommand dialout
sudo chmod a+rw /dev/ttyUSB0 

 
 

example:
open termainal
whoami
$desktop:~$ johndoe

#****Next Add John Doe to dialout group and update permssion
sudo adduser johndoe dialout
sudo chmod a+rw /dev/ttyUSB0

Last step – Reboot computer
I know its Linux and its 2016 but sometimes a reboot is needed to ensure your permission update took place – reboot 🙂

 

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
0 Comments

PowerShell Count Character in String variable

This is the easy way — $var.length

$characters = "abcdefg"
 
#store the number count in $x 
$x= $characters.length
 
write-host $characters.length  $x  
 
#result 
 PS C:\scripts\powershell>  
 7 7
 

Below is the hard way

$characters = "abcdefg" 

$charCount =    ($characters.ToCharArray() | Where-Object {$_} | Measure-Object).Count
 
 
write-host 
 $charCount 
 
PS C:\scripts\powershell 
7  
 
PowerShell Character Count  -

PowerShell Character Count –

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
0 Comments

Arduino LCD Count Down Timer Clock

Simple Count down timer Code can be updated to meet your needs.

Adjust the arduino countdown code for:

  • hours
  • minutes
  • seconds
  • You might need to update the LCD pin out for your brand of LiquidCrystal lcd, my LCD board is a sainsmart 1602

Count Down Timer LCD Arduino

Arduino LCD Count Down Timer Clock

When Arduino count down is completed it says:

END


#include <LiquidCrystal.h>
 //www.brilliantlyeasy.com/ 

int hours = 0; // start hours
int minutes = 0; //start min
int seconds = 5; //start seconds

//LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //<--removed- Different LCD manufacture
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);//Pin Code for Arduino SainSmart LCD 1602 KeyPad

void setup() {
}

void loop() {
 lcd.begin(16, 2);
 lcd.print("Count Down Timer ");

 // lcd.scrollDisplayLeft();
 // wait a bit:
 delay(150);

 while (hours > 0 || minutes > 0 || seconds >= 0) {

 lcd.setCursor(4, 2);

 (hours < 10) ? lcd.print("0") : NULL;
 lcd.print(hours);
 lcd.print(":");
 (minutes < 10) ? lcd.print("0") : NULL;
 lcd.print(minutes);
 lcd.print(":");
 (seconds < 10) ? lcd.print("0") : NULL;
 lcd.print(seconds);
 lcd.display();
 stepDown();
 delay(1000);
 }
}

void stepDown() {
 if (seconds > 0) {
 seconds -= 1;
 } else {
 if (minutes > 0) {
 seconds = 59;
 minutes -= 1;
 } else {
 if (hours > 0) {
 seconds = 59;
 minutes = 59;
 hours -= 1;
 } else {
 trigger();
 }
 }
 }
}

void trigger() {
 lcd.clear(); // clears the screen and buffer
 lcd.setCursor(5, 1); // set timer position on lcd for end.

 lcd.println("END ");
 delay(1000);

 lcd.display();
}

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
5 Comments

Arduino SainSmart LCD 1602 Keyboard Shield

SainSmart 1602 LCD Keypad Shield Example Fix

The issue, my new sainsmart LCD keypad 1602 would not work with the default arduino liquid crystal examples for hello world or any thing else in the example section of LCD. After some research I figured out the issue, the sainsmart has a unique pin layout and there is an easy fix.   The default example uses a LCD  array of  //LiquidCrystal lcd(12, 11, 5, 4, 3, 2); but the sainsmart 1602 has a different layout. The Sainsmart pin array uses LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

Comment out or remove the the LINE of code with (12, 11, 5, 4, 3, 2)


//LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //<--removed
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); //Code for SainSmart 1602 KeyPad
Below is a working code example using the
SainSmart LCD 1602 Keyboard Shield on an Arduino UNO

TIP: dial down the potentiometer screw to get a more clear display, for the brave remove the clear protective plastic film that covers the LCD.

//SainSmart 1602 keypad shield hello world example code
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
lcd.setCursor(0,1); // move to the begining of the second line
lcd.print("Second Line!");
}

void loop() {
// Turn off the display:
//lcd.noDisplay();
delay(500);
//Turn on the display:
lcd.display();
delay(1500);
}

PS: My wife asked if I was programming an old school pager ….I would have to agree with her on  the sainsmart 1602 keypad does look like an old school retro beeper / pager.

None the less… for 10.99 at microcenter it has some serious potential, and loads of fun! perfect for teaching / learning to code on an LCD.

When I had the LCD display “I LOVE YOU” …..  made her smile

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
2 Comments

osx 10.6 print wireless brother HL-L2340DW, HL-2400DW

The Brother site sates that the drivers for the HL-2340DW, HL-L2340DW & HL-2400DW does not work on 10.6.x OSX!

I found an easy way around this, and have it working without issue. This works because the printer is nearly the exact same model on the under lying technology as the older printer drivers.

OSX  10.6 print wireless brother HL-L2340DW, HL-2400DW

Brother customer service may not support this 🙂 BUT ALL I WANT TO DO IS PRINT AND NOW MY WIFE IS HAPPY ~!

1. Setup the WI-FI on the printer manually -under the options menu on the actual printer under the  network menu (This took 10min to figure out the menu options)

2. Under network – Wi-FI find / Search and select your SSID *select the name of you WI-FI network

3. Enter your  pin -password / network key – AGAIN doing all of this on the SMALL lcd screen of the physical printer – pushing up and down on the little  buttons to got to each letter, hitting  the”OK” button to move to next word.

4. Once complete the printer LCD will say connected !  Click the button to go back to main screen

 

5. DOWN LOAD the “not so supported  driver”

Go to the brother website and select –>link

LINK:

Select a Product Group: HL series – Model: HL-2270DW

 

This works since the printer is nearly the exact same model as to its board technology, you are tricking the printer via its driver. 

6. Install the downloaded driver

7. In Systems Preferences of OSX – Click the little + button -> add new printer.

 

Click the IP printer

IP Line Printer

8. Add the IP Address of the printer you setup.

 

Select Printer using Driver  -> Select “Brother HL-2270DW Series CUPS”

DONE — Print to your new PRINTER!

For advanced users  ( I recommended you set your router to have a DHCP exclusion for the IP of the printer)

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
9 Comments

Chrome Fix DNS leaks – SSH / SOCKS Tunneling

Chrome was leaking DNS  on my windows 7 box when attempting to watch the World Series game.  I needed a way to use chrome and watch the game without leaking DNS. After several minuets of wireshark and dns tools it lead me to find the resolution below to fix google Chrome Version 38.0.2125.111 m and its leaking DNS.  

 

1.  Set up a SSH tunnel using windows open-source / free terminal emulator tool  – putty down load –> DOWNLOAD PUTTY  (google  HTTP over SSH  TUNNEL using putty)

2. create a desktop shortcut that links to Chrome.

3. right click the new link and click properties

4. In the shortcut link EDIT  the  Target line to the text below:

“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –proxy-server=”socks5://127.0.0.1:5432″ –host-resolver-rules=”MAP * 0.0.0.0 , EXCLUDE 127.0.0.1″

 

chrome Shortcut

5. Close the shortcut properties and start Chrome using the new link

6. go to a page like cnn.com  — The site should not connect

*Open wire shark and verify that you are using remote DNS and not leaking DNS – The key items are the flags used when starting the shortcut link  ( –proxy-server=”socks5://127.0.0.1:5432″ –host-resolver-rules=”MAP * 0.0.0.0 , EXCLUDE 127.0.0.1″)

 

 

 

 

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
2 Comments

VMware find duplicate IP address for server / vm vCenter VSphere

Script will use POWERCLI to run on your vmware environment *Tested in 5.1 Vsphere

1. download powerCLI *powershell for vmware  – https://my.vmware.com/web/vmware/details?downloadGroup=VSP510-PCLI-510&productId=285 

2. create script findIP.ps1

3. Copy and paste code into file NOTE:(make sure that the line $results= Get-View -Viewtype ………TO……..$strMacToFind)}} is on one line! not multi lines)

#Author  http://brilliantlyeasy.com/
#format of mac address argument in quotes “08:00:69:02:01:FC”
#use the mac of a network setting you know has the correct setting that has a conflict
#to run
# ./findIP.ps1 “08:00:69:02:01:FC”

#connet to vmware
$vCenterSv = ‘YOUR VCENTER SERVER’
$pass = Read-Host “Please enter Administrator password of VMWARE ENV”
$ConnectVcenter= Connect-VIServer -Server $vCenterSv -User administrator -Password $pass

$strMacToFind= $args[0]
$results= Get-View -Viewtype VirtualMachine -Property Name, Config.Hardware.Device | ?{$_.Config.Hardware.Device | ?{($_ -is [VMware.Vim.VirtualEthernetCard]) -and ($_.MacAddress -eq $strMacToFind)}}
write-host $results.name


#format of mac address argument in quotes "08:00:69:02:01:FC"
#use the mac of a network setting you know has the correct setting that has a conflict
#to run
# ./findIP.ps1 "08:00:69:02:01:FC"

#connet to vmware
$vCenterSv = 'YOUR VCENTER SERVER'
$pass = Read-Host "Please enter Administrator password of VMWARE ENV"
$ConnectVcenter= Connect-VIServer -Server $vCenterSv -User administrator -Password $pass

$strMacToFind= $args[0]
$results= Get-View -Viewtype VirtualMachine -Property Name, Config.Hardware.Device | ?{$_.Config.Hardware.Device | ?{($_ -is [VMware.Vim.VirtualEthernetCard]) -and ($_.MacAddress -eq $strMacToFind)}}
write-host $results.name

Find your MAC  Vmware:

Right Click on Vm –> Edit Settings –> Hardware –> Network Adapter 1 — Mac address

 

vmMac

At this point you have all you need — open PowerCLI – cd to where the script is located

RUN the script!

./findIP.ps1  “00:50:56:8d:6b:ab”

*Image below has full code of script

VMware Find Duplicate IP

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
0 Comments

CentOS No “you have new mail” ssh login Fix

LINUX – Command Line Login “You have mail.” Fix

This makes the SSH / command line login say if you have new mail at the time of log on:

Edit two files as root – Adding the text in the file 

Vi — > /etc/pam.d/login

add the following line to bottom of file

session optional pam_mail.so standard

pamLogin

 

Vi — >/etc/pam.d/sshd

add the following line:

session optional pam_mail.so standard noenv

pamSSHD

 

 

By default it seems that CentOS linux does not have the “you have mail ” feature enabled for ssh logins. My issue was that  I had a brand new  Cetos 7 server -> Installed sendmail, setup the box as  mail server and then never the email  notification”you have new mail” at time of ssh login. This sent me down a long path to find the under documented pam.d feature.

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
0 Comments

Mint 17 – Inspiron 1545 no WiFi fix

Mint 17 – Inspiron 1545 no WiFi fix
Dell Inspiron 1545 laptop
1. Put in the Mint 17 CD-Rom or have wired Network connection to web
2. go to menu icon > System Settings>Hardware > Additional Drivers >
3. Click the Check box  USE Broadcom 802.11 Driver
4. Click Apply Changes (bottom right)
5. REBOOT computer

Once the Broadcom driver has been installed and computer has rebooted the wireless networking icon will appear on bottom of tool bar.

mintDriver

 

Mint wifi DellMint1545

Mint wifi DellMint1545

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
1 Comment

PowerShell replace text in files

In the example I am replacing every .html file in the folder that has my line of
the words ‘old Text’ and replacing with words ‘new TeXT’ *(using Power Shell to replace strings)

You can change the file extension and update the location path to a single file to replace text in one file only.

 get-childItem 'C:\scripts\*.txt' -recurse | ForEach {
(Get-Content $_ | ForEach {$_ -replace 'OLD TeXT', ' NEW TeXT'}) | 
Set-Content $_ 
}

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
0 Comments