PINGUINO

ESP2866 Distance

Here we have a demo of the distance that will reach the standard module.

The AP wifi is a APPLE TIME CAPSULE, and the distance is near to 40 mtrs.

IMG_3913

 

The green light describe how we have a correct connection link and the ping delay is into 5 and 50ms.

Greetings.

WIFI to Serial module ESP2866

This is a new module, that will help us to communicate with our ARDUINOS or PINGUINOS modules.

Is like a modem, by all the people that use some time ago the well know US-ROBOTIC, know the AT commands, and the easy way to use it.

The module showed is a BASIC model, but the distance that reach is perfect for domotic or smart home.

Unknown-9

 

The PINOUT

esp8266_schematic

The power supply never will be UP of 3,62Volts

After of some days testing I will say that is recommended that you install a resistor from VCC to CH_PD, to make UP this pin. With an 1k resistor will be perfect.

 

 

The next example code only make a GET of a WEBPAGE, if we run a TCPDUMP in the middle of the NETWORKS we will capture the request.

This code will be compatible with any project ARDUINO or PINGUINO

#define SSID “Walii” //your wifi ssid here
#define PASS “ffffffffff” //your wifi wep key here

#define DST_IP “164.138.31.203” //baidu.com
#define HOST “pinguino.walii.es”

char myChar;

void setup()
{
pinMode(9, OUTPUT);
pinMode(13, OUTPUT);

//blink led13 to indicate power up
for(int i = 0; i<15; i++)
{
digitalWrite(13,HIGH);
delay(50);
digitalWrite(13,LOW);
delay(50);
}

// Open serial communications for WiFi module:
Serial.begin(115200);
// Set time to wait for response strings to be found
Serial.setTimeout(5000);
delay(100);

//test if the module is ready
Serial.println(“AT+RST”);
if(Serial.find(“ready”))
{
delay(1000);
//connect to the wifi
boolean connected=false;
for(int i=0;i<5;i++)
{
if(connectWiFi())
{
connected = true;
break;
}
}
if (!connected)
{
//die
while(1);
}

delay(5000);
//set the single connection mode
Serial.println(“AT+CIPMUX=0”);
}
else
{
delay(100);
}
}

void loop()
{
String cmd = “AT+CIPSTART=\”TCP\”,\””;
cmd += DST_IP;
cmd += “\”,80″;
Serial.println(cmd);
if(Serial.find(“Error”)) return;
cmd = “GET /status HTTP/1.0\r\nHost: “;
cmd += HOST;
cmd += “\r\n\r\n”;

Serial.print(“AT+CIPSEND=”);
Serial.println(cmd.length());
if(Serial.find(“>”))
{
}
else
{
Serial.println(“AT+CIPCLOSE”);
delay(1000);
return;
}

Serial.print(cmd);

delay(500);
//Serial.find(“+IPD”);
while (Serial.available())
{
char c = Serial.read();
delay(50);
}

delay(1000);
}

boolean connectWiFi()
{
Serial.println(“AT+CWMODE=1″);
String cmd=”AT+CWJAP=\””;
cmd+=SSID;
cmd+=”\”,\””;
cmd+=PASS;
cmd+=”\””;
Serial.println(cmd);
delay(2000);
if(Serial.find(“OK”))
{
return true;
}
else
{
return false;
}
}

 

 

TCPDUMP capture.

22:25:46.492679 IP 10.10.10.127.60604 > 164.138.31.203.80: Flags [.], ack 5761, win 638, options [nop,nop,TS val 108106608 ecr 2454109009], length 0
22:25:46.493147 IP 164.138.31.203.80 > 10.10.10.127.60604: Flags [.], seq 5761:7201, ack 73, win 905, options [nop,nop,TS val 2454109009 ecr 108106599], length 1440

 

 

 

 

Specifications and Features

  • Default Baud Rate: 115200
  • 802.11 b / g / n
  • Wi-Fi Direct (P2P), soft-AP
  • Built-in TCP / IP protocol stack
  • Built-in TR switch, balun, LNA, power amplifier and matching network
  • Built-in PLL, voltage regulator and power management components
  • 802.11b mode + 19.5dBm output power
  • Built-in temperature sensor
  • Supports antenna diversity
  • “Off” leakage current is less than 10uA
  • Built-in low-power 32-bit CPU: can double as an application processor
  • SDIO 2.0, SPI, UART
  • STBC, 1×1 MIMO, 2×1 MIMO
  • A-MPDU, A-MSDU aggregation and the 0.4 Within wake
  • 2ms, connect and transfer data packets
  • Standby power consumption of less than 1.0mW (DTIM3)

Reactivando el BLOG.

I have a lot of time without write in this blog, and I want reactivate it, with some news.

1st Place:
As many people have already been realised, I will try to use English in all my next POSTs, I think that is a International language and I need practice a little more. (De igual manera el que quiera consultar en Español, tiene todo el derecho y le contestaré de igual forma).

2dn Place:
I change the name of the blog, I think so that I need to branch out more with the projects, and today I use the Raspberry like base for a lots of projects.

3th Place:
I think that exist a lots of people around the world that maybe don`t have the possibility to learn spanish, but have some knowledge of English.

By finish this POST, I want to say, sorry by my English, I will effort to make this POST easy to read.

Control PINGUINO from MACosx

Hi good morning, this is another project involving PINGUINO mac and I understand that this is very restrictive, but today with the Hackintosh anyone can have a MAC OSX, I say this from me experience.
This is a very basic application that controls both the digital and the analog gates of a PINGUINO 18fx550, whether we use the serial port option as USB with CDC,and also with the bluetooth module tested in previous posts.

Need two parts, a program for MAC,

DOWNLOAD LINK

and the second a code for the PINGUINO,this code is very comprehensive and provides for communications from any platform, works like code, with two digits (by now we do not need more ), the first digit identifies the door and the second the treatment, to the digital port identifies a 0=LOW and 1=HIGH, but for analog ports I have decided that 3 may give the reading order.
So if we want to read analog port 13 which correspond to “AN0” and we would execute “03” us back the digital value between 0 and 1023 of this port.
In the other hand we want to raise the output of the digital port “0” then we send to turn ON “01” and “00” to turn OFF.
Sounds complicate but it is understood when applied
If you want a help, we will sent “9” with any other number, it returns a help.

[sourcecode language=”py”]
/*Project IPHONE, IPAD & MAC talk with PINGUINO walii.es*/
//You need send number port 0 to 7 and status 0 or 1
//for anoalogic port you will check port an0 to an7 and need set status in 3
//for help you need set 9 in the value0
#define LENGTH 3
#define RUNLED PORTAbits.RA4
int rxBuffer[16];
int rxIndex = 0;
int i,value1,value0,value,value0a;
void setup() {
Serial.begin(9600);
for (i=0;i<8;i++) { //servos conections
pinMode(i,OUTPUT);
digitalWrite(i,LOW); // fixe un niveau 0 sur les sorties
}
}

void loop (){
if (Serial.available() > 0) {
//if(rxIndex==0) Serial.printf("Captured first value \n\r");
//if(rxIndex==1) Serial.printf("Captured Second value \n\r");
rxBuffer[rxIndex]=Serial.read();
rxIndex=rxIndex+1;
if(rxIndex==LENGTH){
value0=rxBuffer[0]-48;
value0a=rxBuffer[0]-35;
value1=rxBuffer[1]-48;
if(value1<2)
{
Serial.printf("Port: %d,",value0);
Serial.printf("Status: %d\n\r",value1);
if( value1==0 ) {
digitalWrite(value0,LOW);
} else if (value1==1) {
digitalWrite(value0,HIGH);
}
}
if(value1==3){
value=analogRead(value0a);
Serial.printf("Reading port %d -> An%d value= %d\n\r",value0a,value0,value);
}
if(value0==9) Serial.printf("You need send number port 0 to 7 and status 0 or 1\n\r for analogic port you will check port an0 to an7 \n\r and need set status in 3 for help you need set 9 in the value0\r\n");
rxIndex = 0;
//if (rxIndex==0) Serial.printf("Waiting …\n\r");
}

}
delay(10);
}
[/sourcecode]

Como funciona Pinguino en MAC osx LION

Este video es solo una explicación de como debería funcionar PINGUINO en LION, ya que existen diferencias entre la versión de windows y la de mAC.

Facebook Like Add
Google PLUS ONE
De donde me visitan
Publicidad
Calendario de Posts
September 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930