Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, October 11, 2020

copy file from Rpi to Ubunto Desktop

SSH connect to Rpi using terminal 

>> ssh pi@IP

>>ssh pi@192.168.0.105

 

copy file from Rpi to Ubunto Desktop

>> sudo scp <file in Rpi> <username@IP>:<location to save>

>> sudo scp /home/pi/humidityold.txt asanka@192.168.0.101:home/asanka/Desktop/


If ssh connection is refused by port 22;

>> sudo service ssh status

if not fund 


>> sudo apt-get install openssh-server

Wednesday, April 29, 2020

Microphone noice cancelation in ubantu

This will help to remove background noise when you record, usually in windows with Realtek audio do this job perfectly. but in ubuntu we gonna do it as follows, 

1. Open Nano editor,

        $  sudo nano /etc/pulse/default.pa

2. Now move down to any lines and add the following line to enable Noise cancellation module.

         $  load-module module-echo-cancel

3. Restart Pulse Audio for Noise Cancelling Linux System 
          $ pulseaudio -k 
          $ pulseaudio --start

4.
Set Default Sound Device





Friday, March 20, 2020

Programing AVR on Ubuntu with USBasp

  • Install software package
sudo apt-get install gcc-avr avrdude avr-libc binutils-avr
  • AVR Program
Open your favorite editor and type following code, and save it as led.c 


#define F_CPU 1000000UL
#include
#include
int main(void) {
 DDRC = 255;
 while(1){
 PORTC=255;
 _delay_ms(200);
 PORTC=0;
 _delay_ms(200);
 }
 return 0;
}
  •  Makefile: Shoud avalable always in same folder
It is a good idea to have Makefile for compiling the c code. Download and extract Makefile
file and use the Makefile available inside the archive. This make file was generated MFILE tool under windows 7. Copy Makefile and led.c file to a given folder and run following command on the terminal
make all
You can use "make", "make all", "make clean" and "make program" commands
 
  • Downloading the firmware to AVR
We use avrdude for downloading the generated hex file to the device. Connect you
r USBasp programmer to the computer and the microcontroller. Then run following code for downloading,

sudo avrdude -p m32 -c usbasp -e -U flash:w:led.hex
 
in above code -p followed by m32 is for part number ATmega 32A; -c is for
providing  the programmer's name (hardware programmer); -e is to erase the
device before programing;  -U is to provide progrming location (in this case flash
 in write (w) mode has been selected)

 


reference: https://fos.cmb.ac.lk/esl/programing-avr-ubuntu-14-04-usbasp/ , :avrdude Linux man

Search This Blog