Pinguino as a remote controller for your Linux machine

Yeison is one of the contributor of Pinguino IDE. He’s the one who wrote most of the Python code in the X.3 version. His new deal is to use Pinguino as a remote controller for a Linux machine. Using this python code you can send a shell command with the CDC module and execute it on your computer. We can imagine an IR receiver connected to Pinguino and use a TV remote controller to drive your computer.

First of all, you need to change permissions on the serial port used:
sudo chmod a+rw /dev/ttyACM0

then execute the python code ( download it on Yeison website )

In the Pinguino board, this is a simple example to open the terminal and take a screenshot:

void setup() {
    }
 
void loop() {
    //Open terminal
    CDC.println("shell: gnome-terminal");
    delay(1000);
     
    //Take a screenshot
    CDC.println("shell: gnome-screenshot");
    delay(1000);
    }

Follow Yeison blog to learn more about Pinguino ( in spanish ).

PIC32-PINGUINO Power Supply

I want to build a Temperature sensor powered by a solar panel. I made some test to define the comsuption of Pinguino 32 in different configuration:

First configuration:
Pinguino 32 is powered by its power connector with a 9 Vdc power supply.

The current is about 80 mA on the power supply. Power input is 0,72 Watt.

Second configuration:
Pinguino 32 is powered by its LiPo charger connector ( as it could be with a battery ).

Now the current is about 90 mA. Power input is about 0,324 Watt.
All the tests were done with a clock frequency of 80 Mhz. Then I decided to swith the clock frequency to 40 Mhz and now the current is about 60 mA with 3,6V ( 0,216 Watts ).

Now, just have to find the good solar panel………

HOWTO use the run led !!

The Run led of Pinguino can be used as a normal led. This output is not defined in the list of pins, but you can use it as described below:

#define RUNLED PORTAbits.RA4

void setup()
{
}

void loop()
{
RUNLED=1;
delay(500);
RUNLED=0;
delay(500);
}

Sometimes it could be useful to use it as a general purpose led.

Hidden function in Pinguino

I am working with a GSM modem and Pinguino. To send command to the modem, i used the UART and AT commands. The problem was to set a correct time out when receiving answer from the modem. I wanted to use the millis instruction, but i was afraid by an overflow of the time variable.
So i decided to use a hidden variable in Pinguino, _millis. This variable is used in the arduinodelay library and is incremented every milli second. I copied this example of my code:

 #include <string.h>

unsigned char caractere;
unsigned char chaine[50];
long tempo;
unsigned char index;

unsigned char gsm_echo(unsigned char state)
{
Serial.flush();
_millis=0;
index=0;
if (state) Serial.print("ATE1\r");
else Serial.print("ATE0\r");
while (_millis<100)
{
if Serial.available()
{
caractere=Serial.read();
chaine[index]=caractere;
index++;
}
}
chaine[index]=0;
if (strstr(chaine,"OK")!=0) return 0;
else return 1;
}

void setup()
{
Serial.begin(9600);
pinMode(0,OUTPUT);
digitalWrite(0,LOW);
tempo=millis();
}

void loop()
{
debut:
delay(500);
if (gsm_echo(0)==1) goto debut;
delay(500);
digitalWrite(0,HIGH);
while (1);
}

The millis instruction in the setup function is just used to initialise the library.
_millis variable is already declared in the arduinodelay library.

Hope it will be useful for everybody.

Python on WRT54GL

Now i can run python on my WRT54GL.
First, install an SD CARD on the router:

Then install Python packages on the SD CARD and run Python:

Everything is ready to drive Pinguino with Python serial and OpenWRT !!

JAL with Pinguino

I discovered JAL and tried to make it usable with Pinguino bootloader. It’s done !!
How to do this ?

Upgrade your pinguino with bootloader 2.12
Create your program and compile it with JAL ( i use piklab to do this ),
Convert your program with our jal2pinguino converter: ./jal2pinguino.py jalprog.hex pingprog.hex
Upload your program with VascoBoot.py

Add the option -loader18 8224 -no-fuse to the JAL command line.

links:
pinguino bootloader 2.12
JAL
JALLIB and JALLIB group
jal2pinguino converter written with python
vascoboot uploader written with python

The next Pinguino version will both support Arduino langage and JAL.

Thanks to Vasile, S├ębastien Lelong and Albert Faber from the jallib group.

FONERA, PINGUINO and IPHONE

Yet another walter application. Pinguino is connected to the fonera with the serial port. The Fonera run Lighttpd web server with LUA CGI-BIN. The Iphone is connected to the Fonera web server and drive Fonera GPIO and Pinguino.
Thanks for the video Walter, you did a great job…….

Pinguino/LA FONERA serial interface

La fonera work with a 3,3V power supply. This assembly converts levels from 3,3V to 5V for Pinguino and from 5V to 3,3V for LA FONERA. The Fonera serial connector is inside the box, on the right side.
Be careful, this Pinout is only for FONERA 2100.

Pinguino with LA FONERA


we worked Friday with Benoit espinola on the link beetween LA FONERA and Pinguino. It Works !!
The FONERA was flashed with openwrt 7.09 and the ser2net package was installed. A small interface was build to convert 3,3V signal from the ttyS0 to 5V for the PIC UART.
The last step is to link a FONERA 2 with Pinguino but it seems that i must write a driver for USB.
Benoit Espinola wrote a small processing sketch to test the link:

import processing.net.*;
boolean onoff;

Client c;
String data;

void setup() {
size(200, 200);
background(50);
fill(200);
onoff = true;
c = new Client(this, “192.168.1.1“, 2001); // Connect to FONERA on port 2001
c.write(“W01“); // write W output (0) state of the output (1)
// this is the protocol we defined in the pinguino program
}

void draw() {
if (c.available() > 0) { // If there’s incoming data from the client…
data = c.readString(); // …then grab it and print it
println(data);
}
}

// press the mouse change the state of the output

void mousePressed(){
onoff = !onoff;
c.write(“W0” + int(onoff));
}

// the led is darked when program stop

void stop(){
c.write(“W00“);
}

Nice job Benoit !!