Wednesday, 6 May 2020

Covid-19 Lockdown Update

Hi friends, in this time of global pandemic, all are forced to be inside. To avoid the boredom of self exile some thing extra has to be done to dissipate stored energy. I adapted few of my hobbies to do the same. Today I want to share how and what I was doing during past few weeks.

2m Flower pot Antenna

For my VHF activity I made VK2ZOI design flowerpot antenna. The first one i made is a described here. This one worked exceptionally well it outperformed my existing (refurbished) 5/8 GP. i could reach 30 km with only 5 watts with 59 report from 2 stations and 57 from other stations. Earlier it was not possible to reach them from my QTH (location). After tremendous success, i decided to make its big brother hi-gain dual band antenna described here. I tried it 2 times but i failed miserably. this designed didn't work for me (Might be i missed something). So i kept experimenting on that design on hold 🌝🌝🌝.


SDR on Raspberry PI 3B

SDR is my passion. I am a fan of this Software Defined Radio(SDR) technology. During this boring lock-down, I thought to put SDR softwares on a RPI-3B. Well yes there images available to do SDR on RPI. But they are all based on Raspbian. Though i can work on it as I worked on Ubuntu and Armbian. But Fedora is my choice as I have worked with Redhat earlier.

For Experimenting I need to change image often hence first I enabled USB booting on RPI-3B. Then  Tried some images. If any of you trying or replicating then do remember fedora is a heavier OS for RPI.

Installing Fedora.

REMEMBER  Never jump to load a GUI image directly by downloading.
You know Why I am telling 😅 ......... Yes you are right. So download Fedora minimal image for armhfp from here.  Now either use "dd" or use "disk image writer" to create a USB. USB pendrive should be more than or equals to 8GB. 
(I downloaded Fedora 31 but you can go for latest Fedora 32 also.)
After making the disk boot from it. Next is to enable wifi. the key is you have only nmcli to configure and setup your network. After you are connected to Internet you need to update the system.

sudo dnf update

next is installing SDR software. basic thing is to install RTL-SDR driver. Its easy just use dnf to install if you are ok with 28MHz and above reception. If you need  HF reception without any up-converter , then stock RTL-SDR from fedora repo wont work. For that purpose I will recomend AB9IL . down load it and compile and install it. After installation try rtl_test and rtl_tcp. if you want to use this as remote then you can stop here. Execute 

rtl_tcp -a <ip address of RPI> -p <port default is 1234> -s12000 

Yes keep sampling rate small as RPI doesn't have much power and wifi is unreliable 😛😛😛. From another machine on the same network use gqrx to connect to your RPI and tune FM stations and of course tune  HF to see if you get any... I am sure you will get plenty of Chinese and Arabic stations. I could receive our Local Medium wave station on 972.0KHz only. so you can try your luck.( Note: the sensitivity and frequency range varies from Dongle to Dongle)

Well if you want to venture in to a standalone SDR, then stay with me. The Next step is to put a GUI Desktop environment. One must choose as per his/her personal choice but my experience is bitter with LXQt Gnome and XFCE on RPI-3B. Only LXDE worked smoothly and without much problem. Though i prefere LXQt on my Desktop. 

Next is you have to install SDR Radio software like gqrx or CubicSDR. For any SDR software One need a DSP library. liquidDSP andGnuradio are best in my view. GNURadio available from Fedora repo installs Python-2. But GNURadio 3.8 from github uses Pythom-3 hence no old dependencies. So be prepare to compile GNURadio by yourself. 

How to compile for RPI? 

Well You can compile it on RPI itself but it is never intended. So 
1- copy everything to a folder on your desktop PC 
2- install qemu-user-static on your pc
3- locate qemu-arm-static
4- copy it in to the folder in point 1
5- use chroot and compile on your PC

Though it is standard method this is slow in comparison to compiling directly on RPI.( Atleast on my Intel(R)Core(TM)2Duo CPU E6750@2.66GHz )

using this process GNURadio, gqrx, LiquidDSP, WxWidget, SoapySDR, SoapySDRserver, SoapySDRremote,soapy-rtlsdr and CubicSDR are compiled.
Please refer to individual compilation process described for respective  packages. 

Now Copy back the compiled apps to your Pen drive. Boot from it and try executing gqrx and CubicSDR. 

Note: May complain about Library not found even after executing ldconfig so adjust /etc/ld.so.conf to include /usr/local/lib  
now everything will be fine.

Executing gqrx

Try finding optimum sample rate, band width. Next adjust FFT buffer and speed. Reasonable sound quality will be heard.

Executing CubicSDR

Here multiple settings at multiple areas should be adjusted. Sampling rate, Audo sampling rate and gain to get a good sound quality.





 Cheers 73's
DE VU3VFU 

Monday, 9 March 2020

How to setup LAMP using Fedora 31

There are plenty of documents available on internet and you may be a pro in this field. Well I am new and its for my references and someone like me 😃 trying to learn by doing myself. 
Here I will put the key points to setup a basic LAMP (Linux Apache Mariadb PHP) server all by yourself on your hardware 😃.

Begin 

To start with we have to have a Fedora server or Worksation  ready. To achieve this one can use Live ISO files from Fedora site. Please refer to Documentation on how to do so. Here I assume knowledge of fedora server installation and setup.
The system may be installed on real hardware or on VM(Virtual Machine).

Basic LAMP packages need to be installed

After the bare minimum Fedora server installation, it is required to install the following packages.

php php-cli php-php-gettext php-mbstring php-mcrypt php-mysqlnd php-pear
php-curl php-gd php-xml php-bcmath php-zip mariadb-server httpd.

Use dnf install as root to install the packages and its dependencies. 

Configuration

It is assumed that the network is configured properly and it is accessible from outside world. For Virtual machine, Network setup is bit involved but Internet has many resource. ( Hint: Install a Bridge and go on)

1) SELinux should be set to permissive. (Please do not dissable it)

  • sudo setenforce 0
  • open /etc/selinux/config as root
  • sudo nano /etc/selinux/config
  • change SELINUX=enforcing to SELINUX=permissive
  • save the file

2) PHP setup

  • set timezone in /etc/php.ini 
  • date.timezone = Asia/Kolkata

3) MySQL configuration

  • open /etc/my.cnf.d/mariadb-server.cnf as root
  • in [mysqld] section change characterset to utf8 
character-set-server=utf8
  • start mariadb service
  • sudo systemctl strat mariadb
  • enable the service to run automatically when system boots
  • sudo systemctl enable mariadb
  • setup root password for mariadb by using mysql_secure_installation
  • remove anonymous user
  • disallow remote root login
  • remove test databases and access to it
  • reload previledge tables

4) Firewall setup

  • allow access for HTTP/HTTPS connections
    sudo firewall-cmd --add-service={http,https} --permanent
  • allow mysql access through firewall
    sudo firewall-cmd --add-service=mysql --permanent
  • reload firewall
    sudo firewall-cmd --reload

now you are done. Enjoy your adventure.

Sunday, 12 May 2019

My Experience with Cyclone Fani

The extremely severe cyclonic storm #Fani recently visited Odisha. It is Peculiar to have a Cyclone in this time of year. Though history says earlier there are some cyclones hit Odisha coast during this summer season.
This Cyclone traveled a very long distance to destroy Odisha. This Cyclone originate near equator in Indian Ocean. it crossed east of Srilanka and gradually headed towards Tamilnadu. Without entering into Tamilnadu coast it headed northwards in Bay of Bengal. .

[Path Of Cyclone Fani]
It touched Land in the morning of 3rd May 2019 near Puri( rather On Lake Chilika). It devastated the surrounding. and proceed further to destroy Khurda, Bhubaneswar and Cuttack.

The Major damage it done is to the Lord Jagannath Temple at Puri. Several Stone carvings fell off from the temple The Age old banyan tree KalpaBata is severely damaged. Water sipped into the inner sanctum and deities were not worshiped.

I have seen several Cyclones including #1999SuperCyclone . Though Super cyclone has done a lot of damage, this one is no less. Wind speed of 200kmph with gust 220 to 250 kmph ripped everything in its path. major damages to infrastructures like power grids, cell towers under construction buildings are name a few.

In case of 1999SuperCyclone, Most of the trees are uprooted including several banyan trees. bent most of the electric poles. But this one ripped branches from trunks at some places trees are uprooted. in case of 1999SuperCyclone wind speed reached more than 300 kmph, but Fani reached upto 220 kmph maximum.

At Cuttack Wind started at 9am gradually intensified. Wind blew from North East direction till 1.30pm. Wind Direction suddenly changed due West. This wind caused major damage. 

My Preparedness

I was runner-up in that challenge. My preparation for Cyclone Fani was as per I have described. Well Not all. I have charged emergency light, arranged candles and lantern. Stocked Biscuits and Flat rice. Stored around 15Liters of drinking water. Emergency medicines and fully Charged 3 Baofeng Walkie Talkies. The GP5SSB I got as a gift from SWLINGPost, put new battery in it.   I have downed external antennae for HF and VHF. Baofeng handys are quite good as scanner. I monitored HAM band so I could know the situation in surrounding area and also if situation arises I could give a distress call to Nearby monitoring person. But that situation didn't arise. 

HAM volunteers from WBRC started their communication service since 5th May. They Have setup a VHF in state control room at Bhubaneswar, ADM office Puri and Khurda.
Since 5th may onward I was monitoring and in QSO with VU2IPL(Suresh). VU2FTP VU2XRY VU3YDA and VU3OXI are handling the communication between Puri, Khurda and Bhubaneswar. 

Going ahead
Gradually Normalcy return to Cuttack. water supply was restored from 6th may. And Electricity supply resumed in my locality on 8th May evening. 

Lessons Learnt 
"How much you be prepared for any natural calamity it is less."
My preparation was good no doubt. But the season is summer season. Every season have there advantage and disadvantages. Cyclone in summer brings very uncomfortable climate. Hot and Humid climate makes sweating like hell and dehydrates. So water stock should be more for a family of 8. 
Power backup is not sufficient. Hence a Solar power system or Genset is required to survive after effects of summer cyclones.


#FaniCyclone
#HAM
#HAMRescue

Tuesday, 3 July 2018

My Experiment with Compiler Writing. Part-2


Sorry for a long long delay

As promised I did some experiment but due some other involvement I could not post. Sorry again...

But now i can share some code which translate very few keywords from BASIC to C. Why I choose these 2 language is ease of understanding.

BASIC is like normal English. Even a newcomer can understand the code. C is more professional and has a compiler to compile. BASIC is an interpretive language, Most implementation are interpreter, though some BASIC compilers are available.
Bellow is the code sofar :)

compile under Linux using gcc.
Use a small BASIC file like

REM remarks
FOR i = 0 TO 10
PRINT "Hello World"
NEXT i
a = 5234.9876
b = 123.789
IF a>b  THEN b=a
IF a>=b THEN c = a+b
IF a<>b THEN c = b
IF a<=b THEN c = a
IF a<b THEN c =b
PRINT a,b,c
END 

and see the generated file and enjoy.



/*
 * Parser for BASIC like language
 * 
 * Copyright 2014 Ashok Shankar Das 
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 * 
 * 
 */
#include
#include
#include
#include
//#include "symtab.c"

FILE *source=NULL, *target=NULL, *subf=NULL;

/* ============= Boolean Defination =============== */
typedef enum { false=0,true} bool;

/* ==============Token types ====================== */
typedef enum { 	t_invalid_token=0, t_ident,t_number, t_literal, 
		t_addop, t_mulop, t_lparen, t_rparen, t_less, 
		t_leq, t_neq, t_eql, t_geq, t_gt, 
		t_punctuation, t_keyword,t_dtyp, t_eol,t_skip	} type_of_token;

char *tok_typ[]={"INVALID","IDENTIFIER","NUMBER","LITERAL",
		  "ADDOP", "MULOP", "LPAREN", "RPAREN", "LESS",
		 "LESSEQL", "NOTEQL", "EQUAL", "GREATEQ", "GREATER",
			"PUNCT", "KEYWORD", "DTYP", "EOL", "skip"};
/* ================== Keywords ==================== */

char *keywords[] = { "LET", "FOR", "TO", "STEP", "NEXT", "DIM",
	       "IF", "THEN", "ELSE", "ENDIF", "READ",
	       "DATA", "END", "FUNCTION", "RETURN", "PROGRAM",
	       "INPUT", "PRINT", "INT", "LEFT$", "RIGHT$",
	       "MID$", "CHR", "ASC", "SUB", "RANDOMIZE",
	       "REM", "RND", "AS"};
#define keyword_count sizeof(keywords)/sizeof(char *)

char *type_specifiers[]={"BYTE","INTEGER","LONG","DOUBLE"};
#define dtype_count sizeof(type_specifiers)/sizeof(char *)

/* ========= Double linklist Implementation ====== */
// define a doubly linked list to represent a token.
typedef struct token
{
	char value[50];		// string value
	type_of_token t_type;	// type
	struct token *prev;	// previous token to see previous
	struct token *next;	// next token 
}token;
token *token_list = NULL;		// list which represents the tokens of the program
// Function create_token takes a string and tokentype
// returns pointer to token
token *create_token(char *val, type_of_token t_typ)
{
	token *t =NULL;
	t=(token*)malloc(sizeof(struct token));
	if(t == NULL)
	{
		printf("Error: Unable to allocate memory for token\n");
		exit(-1);
	}
	bzero(t,sizeof(struct token));
	strcpy(t->value,val);
	t->t_type = t_typ;
	t->prev = NULL;
	t->next = NULL;
	return(t);
}

// function push_back puts a token in token_list
// accepts a pointer to a token
// returns a pointer to a token
token *push_back(token *t)
{
	token *temp = token_list;
	// add at the end
	if (token_list)
	{
		temp = token_list;
		while(temp->next != NULL)
			temp=temp->next;
		temp->next=t;
		t->prev = temp;
	}
	else
	{
		token_list = t;
	}
	return (token_list);
}
// Function push_front puts a token at the front of a list
// accepts a pointer to token
// returns a pointer to token
token *push_front(token *t)
{
	if(token_list)
	{
		t->next=token_list;
		token_list->prev = t;
		t->prev = NULL;
		token_list = t;
	}
	else
	{
		token_list = t;
	}
	return(token_list);
}

// Function display_list traverses the token_list and prints the token information
void display_list()
{
	token *list;
	list = token_list;
	int line = 1;
	//printf("DEBUG: token_list at %p\n",token_list);
	while(list!=NULL)
	{
		printf("%s [ %s ]\n",list->value,tok_typ[list->t_type]);
		if(list->t_type == t_eol)
			line +=1;
		list = list->next;
	}
	printf("Total Lines scanned = %d\n",line-1);
}

/* ================ lookahead ==================== */
// Function look look for the next character in the stream
// accepths a FILE pointer
// return a character
char look(FILE *source)
{
	char ch='\0';
	if(!feof(source))
	{
		ch = fgetc(source);
		ungetc(ch,source);
	}
	return ch;
}
/* ============== sacnner Proper =================== */
// Function Parse, actual parser implementation actually it is lexer and parser combined
// accepts FILE pointer
// returns boolean value success or failure
bool scanner(FILE *source)
{
	char peekc, inpc;
	char tmpstr[50];
	bzero(tmpstr,sizeof(tmpstr));
	token *curr_token =NULL;
	type_of_token t_typ = 0; //invalid token 
	
	while(!feof(source))
	{
		peekc= look(source);
		//while(peekc == ' ' || peekc == 0x09)
		//	peekc = (char)fgetc(source);
		inpc = (char)fgetc(source);
		while(true)
		{
			if(isalpha(inpc))	/* symbol */
			{
				int i=0;
				tmpstr[i]=inpc;
				i++;
				bool kw = false;
				while(true)
				{
					peekc = look(source);
					if(isalnum(peekc) || peekc == '_')
					{
						inpc = (char)fgetc(source);
						tmpstr[i] = inpc;
						i++;
					}
					else
					{
						tmpstr[i]='\0';
						break;
					}
				}
				
				for(i =0; i< keyword_count; i++)
				{
					if(strcasecmp(tmpstr,keywords[i])==0)
					{
						kw = true;
						break;
					}
				}
				if(kw == false)
				{
					t_typ = t_ident;
					if(strcasecmp(tmpstr,"AS")==0)
						t_typ = t_skip;
					for(i=0;i')
							{
								t_typ = t_neq;
								inpc = fgetc(source);
								tmpstr[i] = inpc;
								i++;
							}
							else if( peekc == '=')
							{
								t_typ = t_leq;
								inpc = fgetc(source);
								tmpstr[i] = inpc;
								i++;
							}
							break;

					case '>':	t_typ = t_gt;
							peekc = look(source);
							if(peekc == '=')
							{
								t_typ = t_geq;
								inpc = fgetc(source);
								tmpstr[i] = inpc;
								i++;
							}
							break;
					case '+':
					case '-':	t_typ = t_addop;
							break;
					case '*':
					case '/':	t_typ = t_mulop;
							break;
					case '=':	t_typ = t_eql;
							break;
					case '(':	t_typ = t_lparen;
							break;
					
				}
				
				break;
			}			
			break;
		}
		if(t_typ != 0)
		{
			curr_token = create_token(tmpstr,t_typ);
			token_list = push_back(curr_token);
			bzero(tmpstr,sizeof(tmpstr));
			curr_token = NULL;
			t_typ = 0;
		}
	}
	fclose(source);
	return true;
}
void do_header(FILE *target)
{
	if(target == NULL)
		exit(-1);
 
	fprintf(target,"#include \n");
	fprintf(target,"#include \n");
	fprintf(target,"#include \n");
	fprintf(target,"#include \n");
	fprintf(target,"#include \"subrtn.c\"\n");
	fprintf(target,"int main(int argc, char *argv[])\n{\n"); 
}
void do_rem(FILE *target, token *rt)
{
	fprintf(target,"/* ");
	while(token_list->t_type != t_eol)
	{
		fprintf(target,"%s ",token_list->value);
		token_list = token_list->next;
	}
	fprintf(target,"*/\n");
}
void do_dim(FILE *target, token *tmtk)
{
	token *temp = token_list;
	char btype[20]="";
	while(temp->next->t_type!=t_eol)
		temp = temp->next;
	if(strcasecmp(temp->value,"byte")==0)
		strcpy(btype,"unsigned char");
	else if(strcasecmp(temp->value,"integer")==0)
		strcpy(btype,"int");
	else if(strcasecmp(temp->value,"long")==0)
		strcpy(btype,"long");
	else if(strcasecmp(temp->value,"double")==0)
		strcpy(btype,"double");
	else if(strcasecmp(temp->value,"string")==0)
		strcpy(btype,"char*");
	else
	{
		printf("Error in DIM statement found %s expecting valid datatype\n",temp->value);
		fclose(target);
		exit(0);
	}
	// now extract the variable name
	char varnam[20]="";
	token_list = token_list->next;
	if(token_list->t_type!=t_ident)
	{
		printf("Error in DIM statement found %s need variable\n",token_list->value);
		fclose(target);
		exit(0);
	}
	strcpy(varnam,token_list->value);
	token_list = token_list->next;
	if(token_list->t_type == t_lparen)
	{
		strcat(varnam,"[");
		token_list = token_list->next;
		if(token_list->t_type != t_number)
		{
			printf("Error in DIM statement found %s need integer\n",temp->value);
			fclose(target);
			exit(0);
		}
		strcat(varnam,token_list->value);
		strcat(varnam,"]");
	}
	fprintf(target,"%s %s;\n",btype,varnam);
	while(token_list->t_type != t_eol)
		token_list = token_list->next;
}
void do_if(FILE *target, token *iftk)
{
	char sym[20]="";	
	fprintf(target,"if( ");
	token_list = token_list->next;
	if(token_list->t_type != t_ident)
	{
		fclose(target);
		printf("expected symbol found %s \n",token_list->value);
		exit(0);
	}
	strcpy(sym,token_list->value);
	fprintf(target,"%s ",sym);
	token_list = token_list->next;
	if((token_list->t_type != t_less) && (token_list->t_type != t_leq) && (token_list->t_type != t_eql) && (token_list->t_type != t_geq)&&(token_list->t_type != t_gt)&&(token_list->t_type != t_neq))
	{
		fclose(target);
		printf("expected a logical expr but found %s type %s\n ",token_list->value,tok_typ[token_list->t_type]);
		exit(0);
	}
	if(token_list->t_type == t_neq)
	{
		fprintf(target,"%s ","!= ");
	}
	else if(token_list->t_type == t_eql)
	{
		fprintf(target,"%s ","==");
	}
	else
	{
		fprintf(target,"%s ",token_list->value);
	}
	token_list = token_list->next;
	if(token_list->t_type != t_number)
	{
		fclose(target);
		printf("expected a numeric value but found %s\n",token_list->value);
		exit(0);
	}
	fprintf(target,"%s )\n{\n",token_list->value);
	// search for then token
	token_list = token_list->next;
	if(token_list->t_type != t_keyword)
	{
		fclose(target);
		printf("Expected \'then\' found %s\n",token_list->value);
		exit(0);
	}
	if(strcasecmp(token_list->value,"then")!=0)
	{
		fclose(target);
		printf("expected \'then\' \n");
		exit(0);
	}
	token_list = token_list->next;
	// process expression
	// currently just copy the rest
	while(token_list->t_type != t_eol)
	{
		fprintf(target,"%s ",token_list->value);
		token_list = token_list->next;
	}
	fprintf(target,"%s",";\n}\n");
}
void do_for(FILE *target, token *fortk)
{
	char sym[20]="";	
	fprintf(target,"for( int ");
	token_list = token_list->next;	
	if(token_list->t_type != t_ident)
	{
		fclose(target);
		printf("expected symbol found %s \n",token_list->value);
		exit(0);
	}
	strcpy(sym,token_list->value);
	fprintf(target,"%s ",sym);
	token_list = token_list->next;
	
	if(token_list->t_type != t_eql)
	{
		fclose(target);
		printf("expected punctuation ");
		exit(0);
	}
	if( strcmp(token_list->value,"=")!= 0)
	{
		fclose(target);
		printf("= \n");
		exit(0);
	}
	fprintf(target,"= ");
	token_list = token_list->next;
	
	if(token_list->t_type != t_number)
	{
		fclose(target);
		printf("expected integer \n");
		exit(0);
	}
	fprintf(target,"%s; ",token_list->value);
	token_list = token_list->next;
	
	if(strcasecmp(token_list->value,"to")!=0)
	{
		fclose(target);
		printf("expected to \n");
		exit(0);
	}
	token_list = token_list->next;
	
	fprintf(target,"%s <= %s; ",sym,token_list->value);
	if(strcasecmp(token_list->next->value,"step")==0)
	{
		token_list = token_list->next;
		
		token_list = token_list->next;
		
		fprintf(target,"%s += %s)\n{\n",sym,token_list->value);
	}
	else
	{
		fprintf(target,"%s++)\n{\n",sym);
	}
	
	// till now we completed the for( id = init; id cond final; change id value)
	// now we will search for keyword token "NEXT"
	
}

void do_next(FILE *target, token *ntk)
{
	fprintf(target,"\n}\n"); //close the for loop
	token_list=token_list->next;
}
void do_eol(FILE *target,token *ltk)
{
	fprintf(target,";\n");
	token_list = token_list->next;
}
void do_print(FILE *target, token *ptk)
{
	char fmtstr[100]="";
	char prmstr[100]="";
	fprintf(target,"printf(\"");
	token_list = token_list->next;
	while(true)
	{
		if(token_list->t_type == t_literal)
		{
			strcat(fmtstr,"%s ");
			strcat(prmstr,"\"");
			strcat(prmstr,token_list->value);
			strcat(prmstr,"\"");
		}

		if(token_list->t_type == t_ident)
		{
			strcat(fmtstr,"%f ");
			strcat(prmstr,token_list->value);
			strcat(prmstr,"*1.0");
		}
		token_list = token_list->next;
		if(strcasecmp(token_list->value,",")==0)
			strcat(prmstr,",");
		if(token_list->t_type == t_eol)
			break;
	}
	fprintf(target,"%s\",%s",fmtstr,prmstr);
	fprintf(target,");");
	fprintf(target,"printf(\"\\n\");\n");
}

/*void do_sub(FILE *target, token *subtk)
{
	char subdcl[256]="";
	strcpy(subdcl,"void ");
	subtk = subtk->next;
	if(subtk->t_type != t_ident)
	{
		printf("Error: expected subroutine name, found %s\n",subtk->value);
		close(target);
		exit(-1);
	}
	strcat(subdcl,subtk->value);
	subtk = subtk->next; // this must be a punctuation "("
	if(subtk->t_type != t_punctuation)
	{
		printf("Error: expected (  found %s\n",subtk->value);
		close(target);
		exit(-1);
	}
	strcat(subdcl,"(");
	subtk = subtk->next;
	// get the parameter list
	// here  there are 2 possibilities either we encounter a punctuation ')' or we encounter several parameters and punctuations
	// till we get ')' we should traverse the list
	char paramstr[100]="";
	while(	subtk->t_type !=t_eol)
	{
		if(strcasecmp(subtk->next->value,"integer")==0)
			strcat(paramstr,"int ");
		else if(strcasecmp(subtk->next->value,"byte")==0)
			strcat(paramstr,"unsigned char ");
		else if(strcasecmp(subtk->next->value,"string")==0)
			strcat(paramstr,"char* ");
		else
			strcat(paramstr,subtk->next->value);
	}
	
}*/
void generate(FILE *target)
{
	do_header(target);
	token *list;
	list = token_list;
	type_of_token type=0;
	int lin_cnt = 1;
	while(token_list)
	{
		type = token_list->t_type;
		printf("processing \" %s \"token\n",token_list->value);
		if(type == t_keyword)
		{
			if(strcasecmp(token_list->value, "REM")==0)
			{
				// remark comment
				do_rem(target,token_list);
			}
			if(strcasecmp(token_list->value, "for")==0)
			{
				do_for(target,token_list);
			}
			if(strcasecmp(token_list->value, "print")==0)
			{
				do_print(target,token_list);
			}
			if(strcasecmp(token_list->value, "next")==0)
			{
				do_next(target,token_list);
			}
			if(strcasecmp(token_list->value, "dim")== 0)
			{
				do_dim(target,token_list);
			}
			if(strcasecmp(token_list->value, "sub")==0)
			{
//				do_sub(subf,token_list);
			}
			if(strcasecmp(token_list->value, "if")==0)
			{
				do_if(target,token_list);
			}
		}
		if(type == t_eol)
		{
			//do_eol(target,list);
			lin_cnt++;
			//token_list = token_list->next;
		}
		token_list = token_list->next;
	}
	fprintf(target,"}");
	close(target);
	//printf(">>>> Number of lines Processed = %d\n",lin_cnt-1);
}
	
// cradel function to test our parser
int main(int argc, char *argv[])
{
	if(argc<3 bas="" infile="" printf="" s="" sage:=""> \n",argv[0]);
		exit(0);
	}
	
	
	source = fopen(argv[1],"rw"); // open as readonly
	target = fopen(argv[2],"w+"); // open for write only
	subf = fopen("subrtn.c","w+"); // open for write the subroutines and functions
	if(source == NULL)
	{
		printf("Unable to open input file: [%s]\n",argv[1]);
		exit(-1);
	}
	scanner(source);
	display_list();
	fprintf(target,"/*File %s converted with %s from %s dated %s*/\n",argv[2],argv[0],argv[1],__DATE__);
	generate(target);
	return 0;
}


       
 

Sunday, 1 July 2018

CentSDR

Cent SDR!!!

My interest in SDRs take me to any site matches with SDR key word :)
recently I came across a post in FaceBook page of ( Puiu Alexandru ) yo2ldk.

The article referred to in his post is in Japanese language. Though Google translate it to a comprehensible state, but if it was in English then it would have been better. Any ways the look in the picture is nice and very cute!



Though it is a receiver only and priced around $99+6(shipping) as per yo2ldk, in my view it would be a good addition to SWLs and HAMs' shack.

Specification:


  • Frequency: 0.1 to 70 MHz
  • Display: 320 x 240 pixels
  • Supported modes: CW, LSB, USB, AM, WFM (Stereo)
  • Sampling frequency: 48 kHz, 192 kHz
  • USB interface: CDC (serial)
  • Power supply: USB 5 V 200 mA

Thoughts:


  1. WFM bellow 86Mhz in my part that is India is not much useful. So it is desired up to 110MHz. But for HAM use if it can cover up to 150MHz then that will be an asset for every HAM on the moov and companion for every SWL.
  2. Should have( I am not sure it has) some mechanism to send raw data to PC for better DSP using GQRX or SDR#
  3. If it can be complemented with any add-on board for TX capability then it would be a great.


Thanks
de VU3VFU
ASHOK.


Tuesday, 20 March 2018

Eastern India HAM Meet 2018 at Puri.

HAM or amateur radio is a technical hobby. Like any other country in the world.Number of active hams in India is not as much as is in Japan USA or Europe. But people like Farhan VU2ESE, Ramprabhu VU2DEV, Rahul VU3WJM and Charu VU2UPX are name a few... Who made india proud. Eastern India i.e Bihar,Jharkhand, Odisha, West Bengal, Asam and Northeastern states of India had a good number of active HAMs.

For the last 2 years Eastern India HAMs meet on a forum known as EIHM. This year it was organized by HAMs of Odisha and it was held at Puri,Odisha on 17th and 18th March 2018. HAMs from Bihar, Jharkhand, Odisha and West Bengal attained this year. One interesting thing is Banglades HAM Tuhin S21ED also attained this year.

Besides popularizing "Amateur radio" talks and disaster management issues, this years attraction was "Contesting and DXing" delivered by VU2YVK Bijoy. Among technical session "PHSNA" and "UBITX Workshop" delivered by Guru VU3GDP and "modified Tasa's SDR" delivered by Ashok(me) VU3VFU.
On the stage front line from left to right VU2PGU, VU2YVK, VU2JAU, VU2MUE
back line from left to right VU2AES, VU3NEJ, S21ED, VU2PQS, VU3NFF, VU2HRF.

 I am receiving Memento from VU2JAU.

Relaxing in the evening... light technical discussions.

And the Famous Jagannath Temple, for which not only Puri but also Odisha is Famous in the world.



Sunday, 3 December 2017

QRP Power

QRP Power.
Today I completed 200 QSOs. 200th contact is with VU3WBB.
With QRP Power of BITX-40, an inverted-V antenna and with computer SMPS power supply i completed 200 QSOs within a span of 11 months.

Longest distance QSO is East Timor Island (5800Km).
even one IOTA station is on my log book.

3 DX land contacted Indonesia, Malesia and Bangladesh.

other statistics:
Consistent communication( Signal report wise) with VU3MVH/VU2OWB ( Om Abhijit from Nadia, WB).
maximum number of QSOs with VU2NIL(Om Basant).

73's
VU3VFU


AI Adventures...

Hi Friends, Whats Up? A long Period of Silence... during this very long silence period I was preparing for the Fourth phase of Life(Ascetic ...