Skip to main content

Posts

Showing posts from 2013

How to setup 2FA On Linux SSH Login

  This is a simple setup guide to enabling Two Factor Authentication (2FA) on Linux SSH login. I this article I wont go deep into setup and issues that I have faced when implementing this. First thing is first Update your system first. I have used Ubuntu 20.04 and it is always up to date. To enable 2FA you need to install google authenticator modules sudo apt install libpam-google-authenticator Configuration for PAM and SSHD Add the the following line to /etc/pam.d/sshd and After adding this line please restart the sshd services.  auth required pam_google_authenticator.so Go to /etc/ssh/sshd_config and check if the following line exist. Default value will be "no" so change it to "yes" to activate.  ChallengeResponseAuthentication yes Configuration for Authenticator In the terminal run google authenticator command It will ask few things to acknowledge by user. Details you can see from the below video. Once this part is done you are ready to use the 2FA in ubuntu. T

GPS Data logging

 After few months of break finally managed to do some electronics stuff. Before i have tested GPS and SD card so now its combined. GPS data logging to an SD card in CSV format. The main part was to get NMEA data from GPS and convert it to one that i can use. $GPRMC,023042,A,3907.3837,N,12102.4684,W,0.0,156.1,131102,15.3,E,A*36 $GPRMB,A,,,,,,,,,,,,A,A*0B $GPGGA,023042,3907.3837,N,12102.4684,W,1,04,2.3,507.3,M,-24.1,M,,*75 $GPGSA,A,3,04,05,,,09,,,24,,,,,2.8,2.3,1.0*36 $GPGSV,3,2,11,09,47,229,42,10,04,157,00,14,00,305,00,24,70,154,33*79 $GPGLL,3907.3837,N,12102.4684,W,023042,A,A*5E $GPBOD,,T,,M,,*47 $GPVTG,156.1,T,140.9,M,0.0,N,0.0,K*41 $PGRME,8.4,M,23.8,M,25.7,M*2B $PGRMZ,1735,f*34 $PGRMM,WGS 84*06 $HCHDG,,,,15.3,E*30 $GPRTE,1,1,c,*37 $GPRMC,023044,A,3907.3840,N,12102.4692,W,0.0,156.1,131102,15.3,E,A*37 The above is NMEA data that comes our from UART of the GPS. Later capturing the following line to get latitude, longitude, fix, speed etc $GPGGA,023042,3907.3837,N,12102.4684,W,1,04

SIMCOM SIM900A fixed

Since everyone is interested in this post and lots of request comes to get the firmware, i have put a link so that everyone can download it easily. SIMCOM 900A firmware Its been a while that i was trying to fix the SIM900A GSM module. This module support local GSM band but after some researches it was concluded that it is carrier locked :(. After long conversion of days to actual chip manufacture SIMCOM, they told it can be fixed by updating its firmware to latest original version but unfortunately they don't provide firmware to small parties. I never stop trying to get the firmware and SIMCOM again replied, this time they said contact local SIMCOM supplier and request for firmware. But this little Maldives don't have SIMCOM or any electronics manufacturer. So i contacted my friend coody from NOA LABS/Smart prototyping (a friend in china) and told him to help me. I explained him what to do so he can communicate with SIMCOM in china. Finally he sends and email saying that

Project i am working on - Room monitor with SMS alert

first prototype ready to test This a project that i am working on these days, its an room monitor specially for server rooms to monitor temperature and humidity. When the temperature reaches certain level the system will automatically send SMS alert to any number of mobile numbers. Still have few things to be tweaked... will get back with more updates later..

TP-LINK TL-MR3020 router GPIO trigger. Supporting video for previous post

Turning a TP-LINK TL-MR3020 into an Audio player, stream player etc... you name it..

Its been a while i have been messing with TP-LINK TL-MR3020 router. Before with couple of modifications to hardware and software i made a temperature monitor with room light controller via a custom web interface. If you view below links you will have an idea. http://pixelatedpic.blogspot.com/2013/01/openwrt-on-tl-mr3020-controlling-arduino.html http://pixelatedpic.blogspot.com/2013/04/openwrt-on-tl-mr3020-controlling.html This time i flush the TL-MR3020 with Openwrt. After couple of usb packages and audio packages i just plug in the USB sound card (which was given by whoknowz -  https://www.facebook.com/nashith ) to the router. When the USB sound card is detected from the linux, you can check by command dmesg. Then install the madplay or any player you prefer. I installed madplay because it play audio streams and play local files. For test i played the audio stream from atoll radio and it works great. Just ssh the router and pass this command wget -o - http://radioatoll.serve

Arduino + Processing

Processing the data from arduino Processing the data from arduino Recently i found this tool to visualize the data from the arduino or any device. Processing is an arduino IDE like software which is similar syntax as arduino, difference is when it gets data you can draw anything. Example a graph or pan, tilt of an object.

OpenWrt on TL-MR3020 controlling Arduino - CONTINUED

Temperature Monitoring added Now temperature sensor data is view-able from the web interface, LM35 attached to arduino senses the temperature. Once the status update request send from the router to arduino in a given interval, Arduino replies with the pin status and sensor data. That data can be stored in a Lite DB for further use or to draw the graph on the web GUI. Currently it is displayed on the GUI for testing purposes.

ATmega328 is no longer blank, it loaded with Arduino boot loader

Blank ATmega328 flushed with Arduino boot loader Flushed ATmega circuit built and testing with sketches (This  board is named as  "pixelduino") :-) My recent test with Arduino is flushing an ATmega328 with arduino boot loader and its successful. I have an Arduino UNO SMD version and its loaded Arduino ISP sketch, to make it as an ISP programmer. Arduino UNO connected to Blank ATmega328 as an ISP programmer. After  flushing its loaded with blink sketch for test and it works well. So now i can avoid the Arduino board in some of my final projects. 

Arduino and RS485 communication

This experiment was bit delayed due to lack of libraries for RS485 for Arduino. After lots of frustrations, i manage to make it work with soft-serial. Master controller send the command in bytes with [slaveid,status,level] and when a specific id slave response to it and lit and LED. Level byte is an analog value sent by master to dim the LED. RS485 is a long distance communication protocol which is used is several industrial applications so it can be used to monitor and control devices in a twisted pair network. still more to come....

OpenWrt on TL-MR3020 controlling Arduino

After bricking one router i decided not to try to increase the storage and go with the capabilities which it already have. TL-MR3020 from TP-LINK have a UART but the problem with interconnection was  TL-MR3020 out puts 3.3v and Arduino UNO is 5v. So after trying couple for methods trying to level the serial data voltage, finally 74LS04 is used the step up the TX from router to 5v and it was success and Arduino see the data. Then tried to run a shell script from a webpage run in web server inside the router. After couple of frustrations i manage to run with html+javascript...thats a long story... Anyways it works perfectly and more mods will be done soon.