Serial Modem Configuration for Dial-Up in linux

Posted in Embedded on January 7, 2012 by satriant

this is the old stuff that I found in my drawer.
Wavecom Modem GPRS class II. hee…

ok, here I’ll tell you the steps to dialing up the modem
until you got an DNS from your ISP.

checking & setting modem:
1. plug in & power up your modem to serial com
2. goin to your favorite serial terminal.(minicom, gtkterm etc…)
3. example in minicom.
#minicom -s
the terminal will show you the choices and then pick portsetting
the default baudrate of wavecom is 115200
4. setting some modem parameters
in minicom that connected to your modem just enter(without double quote) :
“AT”
if correct, modem should answer
“OK”
then disable echo.
“ATE0″
setting baud
“AT+IPR=115200″
saving configurations
“AT&W”

ok, now exit minicom(ALT-Z-X)

these are the steps of dialing up:

1. make sure that you have wvdial installed, otherwise you have to install it
just enter this command at terminal :

# apt-get install wvdial

2. after you got the wvdial installed, now edit the /etc/wvdial.conf

# vim /etc/wvdial.conf

because I’m using three operator(ISP) this is the configuration
*please suit to your preferred ISP.

[Dialer Defaults]
Init1 = ATZ
Init2 = AT+CGDCONT=1,”IP”,”3gprs”
Modem Type = Analog Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyS0
Username = 3gprs
Password = 3gprs
Baud = 115200

save and exit from editor.

3. now for dialing up, just enter wvdial in your terminal(make sure that you’re root)

# wvdial

if success you’ll get dns and ip from your ISP.
this is the example of my success connection :

tommy@tommy-home:~$ sudo wvdial
–> WvDial: Internet dialer version 1.60
–> Initializing modem.
–> Sending: ATZ
OK
–> Sending: AT+CGDCONT=1,”IP”,”3gprs”
OK
–> Modem initialized.
–> Sending: ATDT*99***1#
–> Waiting for carrier.
CONNECT 115200
~[7f]}#@!}!}!} }6}!}$}%\}”}&} } } } }’}”}(}”}#}$@#&4~
–> Carrier detected. Waiting for prompt.
~[7f]}#@!}!}!} }6}!}$}%\}”}&} } } } }’}”}(}”}#}$@#&4~
–> PPP negotiation detected.
–> Starting pppd at Sat Jan 7 03:17:29 2012
–> Pid of pppd: 2036
–> Using interface ppp0
–> pppd: p�r ��r
–> pppd: p�r ��r
–> pppd: p�r ��r
–> pppd: p�r ��r
–> pppd: p�r ��r
–> local IP address 10.25.146.98
–> pppd: p�r ��r
–> remote IP address 192.168.111.111
–> pppd: p�r ��r
–> primary DNS address 10.0.18.54
–> pppd: p�r ��r
–> secondary DNS address 10.0.28.3
–> pppd: p�r ��r

OK, tengkyu and goodnite :)

on going —-> DONE

Posted in Uncategorized on October 27, 2011 by satriant

1. robot explorer:
special function robot for search & rescue.
wireless control up to 100 meters
AVR Atmega16 for Controller
wireless camera with auto brightness
4 DOF Arm for Catch Something / Grip

UPDATED : DONE

2. Radar Simulation
This simulation for non-comercial
Output Image drawn to Framebuffer
2-D Vector Imaging Technology

UPDATED : DONE

3. Home Automation & Security
Automation for some kind of home appliance
PIR Sensors & Camera
Capturing Image when the Movement Sensor Triggered

UPDATED : DONE

someday if I have any spare time, I will post the picture and how them work :)

Installing and setting TFTPD in Ubuntu

Posted in Embedded with tags , , on October 20, 2011 by satriant

1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp

2. Create /etc/xinetd.d/tftp and put this entry:

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}

3. Make /tftpboot directory

$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot

4. Start tftpd through xinetd

$ sudo /etc/init.d/xinetd start

You don't have to listen. I just like to talk.

Posted in Uncategorized on May 18, 2011 by satriant

Sometimes we just need a place to talk, even if no one is really listening. Although, to be honest, I really hope someone is listening!

NMEA Parser – GPS Messages

Posted in Electronics and Robotics on April 21, 2011 by satriant

okay..enough boss.., gw jadi orang multitalenan d kantor. smua2 knp harus gw, tp okelah gw juga lagi nuntut ilmu..hehehe…

NMEA : whats NMEA ?

NMEA is a combined electrical and data specification for communication between marine electronic devices such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the U.S.-based National Marine Electronics Association

okeh, dont be pusing ya, NMEA is one of many Message Protocol from GPS Satellite.

These are how you get your location from NMEA message :

from your GPS receiver u just listen to Serial Ports that have configurations:

 CONFIGS:

1. ini pake alias this using fix baudrate 4800

2. databits 8

3. Parity – NONE

4. STOP bits 1

5. Handshake – None, if u wanna force of this handshake, just handshake with ur own hand..hahahahaha
ANSI C / Parser Program :

for example this is what u got from your receiver
$GPRMC,095146.000,A,0615.5814,S,10647.3518,E,0.16,238.45,090211,,,A*79

$GPVTG,238.45,T,,M,0.16,N,0.3,K,N*0E

$GPGGA,095147.000,0615.5811,S,10647.3526,E,1,03,3.2,57.6,M,2.9,M,,0000*4B

$GPGSA,A,2,12,18,25,,,,,,,,,,3.4,3.2,1.0*39

$GPRMC,095147.000,A,0615.5811,S,10647.3526,E,0.33,248.75,090211,,,A*73

$GPVTG,248.75,T,,M,0.33,N,0.6,K,N*08

$GPGGA,095148.000,0615.5808,S,10647.3532,E,1,03,3.2,57.6,M,2.9,M,,0000*49

$GPGGA,095149.000,0615.5803,S,10647.3542,E,1,03,3.2,57.7,M,2.9,M,,0000*45

$GPGSA,A,2,12,18,25,,,,,,,,,,3.4,3.2,1.0*39

$GPRMC,095149.000,A,0615.5803,S,10647.3542,E,1.11,73.30,090211,,,A*46

$GPVTG,73.30,T,,M,1.11,N,2.1,K,N*37

$GPGGA,095150.000,0615.5803,S,10647.3537,E,1,03,3.2,57.6,M,2.9,M,,0000*4E

$GPGSA,A,2,12,18,25,,,,,,,,,,3.4,3.2,1.0*39

$GPGGA,095151.000,0615.5802,S,10647.3536,E,1,03,3.2,57.7,M,2.9,M,,0000*4E

NOW can u read what they mean? hihihihihi…

in this program I just parse the GPGGA part that is enough to get your LATITUDE & LONGITUDE

#include <stdio.h>
#include <string.h>

int main()
{
FILE *file = fopen(“gps.txt”, “r”);
char Buffer[1024] = {0};
char temp [512] = {0};
while(fgets(Buffer,1024,file) != NULL)
{
if(Buffer[0] == ‘$’)
{
if (memcmp(Buffer+1,”GPGGA”,5) == 0)
{
printf(“—————————–\n”);
printf(“%s\n”, Buffer);
char *token = strtok(Buffer+6,”,”);
int i = 0;
while(token != NULL)
{
switch(i)
{
case 0:
// cout <<”Universal Time Coordinated (UTC): ” <<token << endl;
break;
case 1:
strcpy(temp,token);
token = strtok(NULL,”, “);
strcat(temp,”, “);
strcat(temp,token);
printf(“Latitude : %s\n”, temp);
i++;
break;
case 2:
// cout << “North or South :” <<token << endl;
break;
case 3:
strcpy(temp,token);
token = strtok(NULL,”, “);
strcat(temp,”, “);
strcat(temp,token);
i++;
printf(“Longitude : %s\n”, temp);
break;
case 4:
// cout <<”East or West :” <<token << endl;
break;
case 5:
// cout << “GPS Quality Indicator :”<<token << endl;
break;
case 6:
// cout << “Number of satellites in view, 00 – 12 :”<<token << endl;
break;
case 7:
// cout << “Horizontal Dilution of precision :”<<token << endl;
break;
case 8:
strcpy(temp,token);
token = strtok(NULL,”, “);
strcat(temp,”, “);
strcat(temp,token);
i++;
printf(“Altitude : %s\n”, temp);
break;
case 9:
// cout << “Units of antenna altitude, meters :”<<token << endl;
break;
case 10:
// cout << “Geoidal separation :”<<token << endl;
break;
case 11:
// cout << “Units of geoidal separation :”<<token << endl;
break;
case 12:
// cout << “Age of differential GPS data :”<<token << endl;
break;
case 13:
// cout << “Differential reference station ID :”<<token << endl;
break;
case 14:
// cout << “Checksum :”<<token << endl;
break;
default:
break;
}
i++;
token = strtok(NULL,”,”);
}
getchar();
}
}
}
}

error while loading shared libraries: /usr/local/lib/libgcc_s.so.1: ELF file OS ABI invalid

Posted in Uncategorized with tags , on April 18, 2011 by satriant

heelooo… this is happen after I’ finished installing one application from apt-get.

when u open a application from terminal, it would appear something like this :

error while loading shared libraries: /usr/local/lib/libgcc_s.so.1: ELF file OS ABI invalid

problem:
the libgcc_s.so.1 wasn’t succesfully linked.

just check at :
ls -l /lib/libgcc_s.so.1

thats the correct lib and now you can remove the /usr/local/lib.libgcc_s.so.1 and replace with the correct lib.

# cp /lib/libgcc_s.so.1 /usr/local/lib/libgcc_s.so.1

now, all work fine.. hehe…

Changing IP Address from DHCP to Static IP in Ubuntu

Posted in Common on April 7, 2011 by satriant

Hello… this will remind me.. hihhihi…

ok, lets now open the interfaces file

$ sudo vim /etc/network/interfaces

for the default, you’ll see in the file

auto eth0
iface eth0 inet dhcp

ok, now we’re going to change the way from DHCP to Static, just enter these text, and suit to your needs

auto eth0
iface eth0 inet static
address        192.168.1.100
netmask     255.255.255.0
network      192.168.1.0
broadcast  192.168.1.255
gateway     192.168.1.1

now, set the DNS setting by open and edit the file

$ sudo vim /etc/resolv.conf

on the line “name server xxx.xxx.xxx.xxx”  replace the x with your nameserver,

you can do ifconfig /all to find out what they are.

ok, thats all…  the last u have to do is, removing the DHCP client and Restart the Net-Interface

$ sudo apt-get remove dhcp-client

& restart the network

$ sudo /etc/init.d/networking restart

 

See you….. :)

 

 

Tugas Akhir!!

Posted in Uncategorized on March 17, 2011 by satriant

Advanced System Control.

Self Balancing Vehicle with Artificial Neural Network

Tommy Agustianto – Teknik Elektro
Universitas Indonesia

Terminator – Multi ViewTerminal

Posted in Common on November 29, 2010 by satriant

Ctrl-Shift-E: will split the view vertically.

Ctrl-Shift-O: will split the view horizontally.

Ctrl-Shift-P: will focus be active on the previous view.

Ctrl-Shift-N: will focus be active on the next view.

Ctrl-Shift-W: will close the view where the focus is on.

Ctrl-Shift-Q: will exit terminator.

F11: will make terminator go fullscreen.

Accessing Parallel Port on Unix/Linux Systems

Posted in Embedded with tags , , on November 14, 2010 by satriant

Hello..long time no see….
karna ksibukan, saya baru bisa nulis lagi nih, ni malam minggu setelah pulang dari rumah pacar dan akhirnya ga bisa bo2, akhirnya ngoding dikit lah, ada rokok sama kopi, ada solder dan teman2nya… dan hayu kita oprekan lagiiiii…..

pengenalan parallel port
paralel port biasa d gunakan untuk komunikasi printer, makanya port ini juga sering di sebut printer port. port ini beralamat di 0x378H pada PC.
standartnya itu, di mulai dari dulu, di IBM PC-XT, unix system.

mempunyai beberapa komponen, yaitu port data, status dan interrupt.
dsini saya akan ngasih tau cara mrogram 8 bit data bus pada parallel port, yaitu dari mulai D0-D7

saya ngerjain ini dalam waktu 15 menit, so…ikutin step2nya nih..
1.siapin parallel male connector.
2.bikin led bederet 8 biji, pake resistor R-pack
3.sambungin/solder anoda pada masing2 led ke port D0-D7 (pin 2 sampe 9)
4.jgn lupa untuk ngisep roko anda, nanti jatoh ke karpet *pengalaman pribadi*
5.pasang tuh alat ke parallel port komputer/laptop

kita buka vim atau apalah yang mau kamu pake, gedit atau notepad++ atau kwrite..

tulis source code ini….., ini dah d tes loh dan jalan sebagai mana mestinya…

Hello..long time no see….
karna ksibukan, saya baru bisa nulis lagi nih, ni malam minggu setelah pulang dari rumah pacar dan akhirnya ga bisa bo2, akhirnya ngoding dikit lah, ada rokok sama kopi, ada solder dan teman2nya… dan hayu kita oprekan lagiiiii…..

<b>pengenalan parallel port</b>
paralel port biasa d gunakan untuk komunikasi printer, makanya port ini juga sering di sebut printer port. port ini beralamat di 0x378H pada PC.
standartnya itu, di mulai dari dulu, di IBM PC-XT, unix system.

mempunyai beberapa komponen, yaitu port data, status dan interrupt.
dsini saya akan ngasih tau cara mrogram 8 bit data bus pada parallel port, yaitu dari mulai D0-D7

saya ngerjain ini dalam waktu 15 menit, so…ikutin step2nya nih..
1.siapin parallel male connector.
2.bikin led bederet 8 biji, pake resistor R-pack
3.sambungin/solder anoda pada masing2 led ke port D0-D7 (pin 2 sampe 9)
4.jgn lupa untuk ngisep roko anda, nanti jatoh ke karpet *pengalaman pribadi*
5.pasang tuh alat ke parallel port komputer/laptop

kita buka vim atau apalah yang mau kamu pake, gedit atau notepad++ atau kwrite..

tulis source code ini….., ini dah d tes loh dan jalan sebagai mana mestinya…

/*
+——————————————————+
|    Simple Paralel Port Programming      |
|        XSATRIA – 2010                                              |
+——————————————————+
*/

#include <stdio.h>
#include <unistd.h>
#include <sys/io.h>
#include <stdlib.h>

/* paralel port address */
#define BASEPORT    0×378

int main(int argc, char *argv[])
{
unsigned char value;
int i;

/* get the value from arguments*/
if (argc < 2) {
printf(“enter port value\n”);
return (-1);
}

/* convert it to numbers type */
value = atoi(argv[1]);
printf(“value = 0x%x\n”, value);

/* set input/output permissions */
if (ioperm(BASEPORT, 3, 1)) {
perror(“ioperm”);
return(-1);
}

/* blinking the leds that connect to D0-D7 */
for (i=0; i<=1000; i++) {
outb(value, BASEPORT);
usleep(100000);
outb(~value, BASEPORT);
usleep(100000);
}

printf(“status : 0x%X \n”, inb(BASEPORT + 1));

/* we dont need the ports anymore, just close it*/
if (ioperm(BASEPORT, 3, 0)) {
perror(“ioperm”);
return(-1);
}

return(0);
}

 

sekarang, compile tuh program :

# gcc -o paraleltest paraleltest.c

jalanin programnya(kamu harus jadi root untuk jalanin program ini, soalnya doi kan ngakses IO) dan lihat tuh lednya… ngedap-ngedip bukan?? hohohoho…..it works now..

ok…sepertinya udah malem nih..bo2 yuks..

 

regards

 

tommy

Follow

Get every new post delivered to your Inbox.