Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: Using SIM900 GPRS shield to send sms on: March 31, 2013, 01:08:11 pm
I think you can't send Control Z from the Serial Monitor
make it in your code

Serial.println((char)26);
or
Serial.write(0x1A);
2  Using Arduino / Networking, Protocols, and Devices / Re: SIM300 GPRS Connection CLOSED problem on: March 31, 2013, 01:06:03 pm
I'm working on that smiley

Thanks a lot for your reply, really it's helpful.

3  Using Arduino / Networking, Protocols, and Devices / Re: XML Parser on: March 23, 2013, 11:49:17 am
I'm working on a similar project just I'm in the beginning , hope you fix it soon
4  Using Arduino / Networking, Protocols, and Devices / Re: SIM300 GPRS Connection CLOSED problem on: March 23, 2013, 11:23:43 am
Yes, the problem was in google docs, I've tested Google.com successfully  smiley
I have send data successfully  in the URL, my inquiry now, How can I control my Arduino from my website?
5  Using Arduino / Networking, Protocols, and Devices / SIM300 GPRS Connection CLOSED problem on: March 19, 2013, 01:12:07 pm
Hello Everyone,

I need to make a TCP connection to send Data to a Web server, everything is okay except my big problem smiley-sad

The problem is After I sent
AT+CIPSTART="TCP","spreadsheets.google.com","443"
I got
OK
CONNECT OK
then I sent
at+cipsend
> GET /formResponse?formkey=dFlabUV1Vk1qU1NZcFlMb1ZZY25MQ nc6MQ&entry.0.single=8.255&entry.1.single=32.11&su bmit=Submit HTTP/1.1
Host: spreadsheets.google.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en
Accept-Encoding: gzip, deflate
Connection: keep-alive

^Z
----------------
I get CLOSED & the modem stops responding smiley-sad

CLOSED

I actually have to physically restart the MODEM at this point

Any help please smiley-sad
6  Using Arduino / Networking, Protocols, and Devices / Re: SIM300 GSM on: March 18, 2013, 04:02:58 pm
As I remember this module need power source in the range of 3.4 to 4.5 V but be careful it also need a current Burst 2A (not on all cases)

and Arduino provide 3.3v and 5v but the current not excess 1A
7  Using Arduino / Project Guidance / Re: Need to write a small code to switch USB Dongle to modem mode on: February 09, 2013, 03:03:48 pm
Sorry I forgot to tell you that I'm using USB Host shield (which depend on MAX3421E).
and I'm knowing about the USB stick it's a combo device contain Modem & CD & Card Reader devices
I have found that AT^U2DIAG=0  runs the USB Stick in the Modem Mode only
I used putty(an app like Hyperterminal) and sent AT^U2DIAG=0 so the USB Stick runs now in the Modem Mode only

As I explained earlier, I'm using Arduino Mega and trying to modify this example to get my modem work

Code:
/* Arduino terminal for PL2303 USB to serial converter and DealeXtreme GPRS modem. */
/* USB support */
#include <avrpins.h>
#include <max3421e.h>
#include <usbhost.h>
#include <usb_ch9.h>
#include <Usb.h>
#include <usbhub.h>
#include <avr/pgmspace.h>
#include <address.h>
/* CDC support */
#include <cdcacm.h>
#include <cdcprolific.h>
/* Debug support */
#include <printhex.h>
#include <message.h>
#include <hexdump.h>
#include <parsetools.h>

class PLAsyncOper : public CDCAsyncOper
{
public:
    virtual uint8_t OnInit(ACM *pacm);
};

uint8_t PLAsyncOper::OnInit(ACM *pacm)
{
    uint8_t rcode;
   
    // Set DTR = 1
    rcode = pacm->SetControlLineState(1);

    if (rcode)
    {
        ErrorMessage<uint8_t>(PSTR("SetControlLineState"), rcode);
        return rcode;
    }

    LINE_CODING lc;
    //lc.dwDTERate = 9600;
    lc.dwDTERate = 115200;
    lc.bCharFormat = 0;
    lc.bParityType = 0;
    lc.bDataBits = 8;

    rcode = pacm->SetLineCoding(&lc);

    if (rcode)
        ErrorMessage<uint8_t>(PSTR("SetLineCoding"), rcode);
           
    return rcode;
}
USB Usb;
//USBHub Hub(&Usb);
PLAsyncOper AsyncOper;
PL2303 Pl(&Usb, &AsyncOper);

void setup()
{
  Serial.begin( 115200 );
  Serial.println("Start");

  if (Usb.Init() == -1)
      Serial.println("OSCOKIRQ failed to assert");
     
  delay( 200 );
}

void loop()
{
    Usb.Task();
 
    if( Usb.getUsbTaskState() == USB_STATE_RUNNING )
    {
       uint8_t rcode;
       
       /* reading the keyboard */
       if(Serial.available()) {
         uint8_t data= Serial.read();
       
         /* sending to the phone */
         rcode = Pl.SndData(1, &data);
         if (rcode)
            ErrorMessage<uint8_t>(PSTR("SndData"), rcode);
       }//if(Serial.available()...
       
        /* reading the converter */
        /* buffer size must be greater or equal to max.packet size */
        /* it it set to 64 (largest possible max.packet size) here, can be tuned down
for particular endpoint */
        uint8_t buf[64];
        uint16_t rcvd = 64;
        rcode = Pl.RcvData(&rcvd, buf);
         if (rcode && rcode != hrNAK)
           ErrorMessage<uint8_t>(PSTR("Ret"), rcode);
           
           if( rcvd ) { //more than zero bytes received
             for(uint16_t i=0; i < rcvd; i++ ) {
               Serial.print((char)buf[i]); //printing on the screen
             }
           }//if( rcvd ...
    }//if( Usb.getUsbTaskState() == USB_STATE_RUNNING..
}

I tried this code with these USB Modems list :
ZTE MF180
Huawei E303
Huawei E220
Huawei k3565
Huawei k3765
Huawei K3770

but unfortunately attempt didn't succeed smiley-sad

Reference files
https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/pl2303/pl2303_gprs_terminal/pl2303_gprs_terminal.pde
https://github.com/felis/USB_Host_Shield_2.0/blob/master/cdcprolific.cpp
https://github.com/felis/USB_Host_Shield_2.0/blob/master/cdcprolific.h

I think the problem is in the cdcprolific.h & cdcprolific.cpp If I could to edit a few data in them, I'm sure I will get my USB Modem work

I hope anyone guide me what I do to get it work

I have used an a USB Sniff program to get the initial details till the PC detect the modem

Code:
1 in down n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE
  URB Header (length: 80)
  SequenceNumber: 1
  Function: 000b (GET_DESCRIPTOR_FROM_DEVICE)
 
1 in up n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE 0x00000000
  URB Header (length: 80)
  SequenceNumber: 1
  Function: 000b (GET_DESCRIPTOR_FROM_DEVICE)
 
2 in down n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE
  URB Header (length: 80)
  SequenceNumber: 2
  Function: 000b (GET_DESCRIPTOR_FROM_DEVICE)
 
2 in up n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE 0x00000000
  URB Header (length: 80)
  SequenceNumber: 2
  Function: 000b (GET_DESCRIPTOR_FROM_DEVICE)
 
3 in down n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE
  URB Header (length: 80)
  SequenceNumber: 3
  Function: 000b (GET_DESCRIPTOR_FROM_DEVICE)
 
3 in up n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE 0x00000000
  URB Header (length: 80)
  SequenceNumber: 3
  Function: 000b (GET_DESCRIPTOR_FROM_DEVICE)
 
4 ??? down n/a 0.000 SELECT_CONFIGURATION
  URB Header (length: 100)
  SequenceNumber: 4
  Function: 0000 (SELECT_CONFIGURATION)
  Configuration Descriptor:
  bLength: 9 (0x09)
  bDescriptorType: 2 (0x02)
  wTotalLength: 39 (0x0027)
  bNumInterfaces: 1 (0x01)
  bConfigurationValue: 1 (0x01)
  iConfiguration: 1 (0x01)
  bmAttributes: 224 (0xe0)
    0x80: Bus Powered
    0x40: Self Powered
    0x20: Remote Wakeup
  MaxPower: 250 (0xfa)
    (in 2 mA units, therefore 500 mA power consumption)
 
  Number of interfaces: 1
  Interface[0]:
    Length: 0x004c
    InterfaceNumber: 0x02
    AlternateSetting: 0x00
    Class             = 0x00
    SubClass          = 0x00
    Protocol          = 0x00
    InterfaceHandle   = 0x00000000
    NumberOfPipes     = 0x00000003
    Pipe[0]:
      MaximumPacketSize = 0x0000
      EndpointAddress   = 0x00
      Interval          = 0x00
      PipeType          = 0x00
        UsbdPipeTypeControl
      PipeHandle        = 0x00000000
      MaxTransferSize   = 0x00001000
      PipeFlags         = 0x00
    Pipe[1]:
      MaximumPacketSize = 0x0000
      EndpointAddress   = 0x00
      Interval          = 0x00
      PipeType          = 0x00
        UsbdPipeTypeControl
      PipeHandle        = 0x00000000
      MaxTransferSize   = 0x00001000
      PipeFlags         = 0x00
    Pipe[2]:
      MaximumPacketSize = 0x0000
      EndpointAddress   = 0x00
      Interval          = 0x00
      PipeType          = 0x00
        UsbdPipeTypeControl
      PipeHandle        = 0x00000000
      MaxTransferSize   = 0x00001000
      PipeFlags         = 0x00
 
4 ??? up n/a 0.000 SELECT_CONFIGURATION 0x00000000
  URB Header (length: 100)
  SequenceNumber: 4
  Function: 0000 (SELECT_CONFIGURATION)
  Configuration Descriptor:
  bLength: 9 (0x09)
  bDescriptorType: 2 (0x02)
  wTotalLength: 39 (0x0027)
  bNumInterfaces: 1 (0x01)
  bConfigurationValue: 1 (0x01)
  iConfiguration: 1 (0x01)
  bmAttributes: 224 (0xe0)
    0x80: Bus Powered
    0x40: Self Powered
    0x20: Remote Wakeup
  MaxPower: 250 (0xfa)
    (in 2 mA units, therefore 500 mA power consumption)
 
  Number of interfaces: 1
  Interface[0]:
    Length: 0x004c
    InterfaceNumber: 0x02
    AlternateSetting: 0x00
    Class             = 0xff
    SubClass          = 0xff
    Protocol          = 0xff
    InterfaceHandle   = 0x85adc0a8
    NumberOfPipes     = 0x00000003
    Pipe[0]:
      MaximumPacketSize = 0x0040
      EndpointAddress   = 0x83
      Interval          = 0x05
      PipeType          = 0x03
        UsbdPipeTypeInterrupt
      PipeHandle        = 0x85adc0c4
      MaxTransferSize   = 0x00001000
      PipeFlags         = 0x00
    Pipe[1]:
      MaximumPacketSize = 0x0200
      EndpointAddress   = 0x84
      Interval          = 0x20
      PipeType          = 0x02
        UsbdPipeTypeBulk
      PipeHandle        = 0x85adc0e4
      MaxTransferSize   = 0x00001000
      PipeFlags         = 0x00
    Pipe[2]:
      MaximumPacketSize = 0x0200
      EndpointAddress   = 0x03
      Interval          = 0x20
      PipeType          = 0x02
        UsbdPipeTypeBulk
      PipeHandle        = 0x85adc104
      MaxTransferSize   = 0x00001000
      PipeFlags         = 0x00
 
5 out down n/a 0.000 CLEAR_FEATURE_TO_DEVICE
  URB Header (length: 80)
  SequenceNumber: 5
  Function: 0010 (CLEAR_FEATURE_TO_DEVICE)
 
5 out up n/a 0.000 CONTROL_TRANSFER - 0x00000000
  URB Header (length: 80)
  SequenceNumber: 5
  Function: 0008 (CONTROL_TRANSFER)
  PipeHandle: 854c8a90
 
  SetupPacket:
  0000: 00 01 01 00 00 00 00 00
  bmRequestType: 00
    DIR: Host-To-Device
    TYPE: Standard
    RECIPIENT: Device
  bRequest: 01 
    CLEAR_FEATURE

  No TransferBuffer
 
6 ??? down n/a 0.000 RESET_PIPE
  URB Header (length: 24)
  SequenceNumber: 6
  Function: 001e (RESET_PIPE)
 
6 ??? up n/a 0.000 RESET_PIPE 0x00000000
  URB Header (length: 24)
  SequenceNumber: 6
  Function: 001e (RESET_PIPE)
 
7 ??? down n/a 0.000 RESET_PIPE
  URB Header (length: 24)
  SequenceNumber: 7
  Function: 001e (RESET_PIPE)
 
7 ??? up n/a 0.000 RESET_PIPE 0x00000000
  URB Header (length: 24)
  SequenceNumber: 7
  Function: 001e (RESET_PIPE)
 
8  Using Arduino / Project Guidance / Need to write a small code to switch USB Dongle to modem mode on: February 02, 2013, 05:04:59 pm
Hello All,
I'm trying to connect a USB Dongle to Arduino Mega, everything okay but there is a little problem.

My USB Modem Huawei k3770 has 2 modes Mass storage mode that's the initial and modem mode
when I plug it to my PC it's shown as Mass storage to get driver and the dashboard .. etc after installing it the modem mode will be shown to get connection.

to connect it to my usb host shield I need firstly to do mode switch
By examine the usbmodeswitch debug log in a linux system I found the required details
Code:
DefaultVendor= 0x12d1
DefaultProduct= 0x14d1
TargetVendor= 0x12d1
TargetProduct= 0x14c9
TargetClass= not set
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint= not set
MessageContent="55534243123456780000000000000011062000000100000000000000000000"

so I think the important details is
DefaultVendor= 0x12d1
DefaultProduct= 0x14d1
TargetVendor= 0x12d1
TargetProduct= 0x14c9
MessageContent="55534243123456780000000000000011062000000100000000000000000000"


but unfortunately I don't know how I can use these details with my software
Could anyone tell me how I can make some coding in my software to switch Huawei k3770 to modem mode firstly before I sent AT Commands?

Thanks in advance,
Karim
9  Using Arduino / Project Guidance / Re: Interfacing TDS/EC Tester/Meter on: December 22, 2012, 05:06:10 pm
So I bought a TDS Meter from ebay and it’s a cheap one

Have you confirmed that the meter does actually work, before trying to reverse engineer it?

Yes, it's working perfectly
10  Using Arduino / Project Guidance / Re: Interfacing TDS/EC Tester/Meter on: December 14, 2012, 01:04:46 pm
unfortunately all control lines of the LCD give me 3V (which is the VCC) whatever the meter is in water or not smiley-sad

now I'm trying to take the I/P of the sensor then search about a relation to give me the exact TDS

11  Using Arduino / Project Guidance / Re: Interfacing TDS/EC Tester/Meter on: December 10, 2012, 08:25:03 am
I'm trying to check those lines under push-bottoms and take readings for clear water and salty water

I've already found http://www.octiva.net/projects/ppm/ but I prefer to hack that meter and take the reading directly.
12  Using Arduino / Project Guidance / Interfacing TDS/EC Tester/Meter on: December 08, 2012, 01:22:32 pm
I am working on a project regarding the water pollution and I am using a TDS Meter to indicate the Total Dissolved Solids (TDS) of a solution, i.e. the concentration of dissolved solids in it. Since dissolved ionized solids such as salts and minerals increase the conductivity of a solution, a TDS meter measures the conductivity of the solution and estimates the TDS from that. Dissolved organic solids such as sugar and microscopic solid particles such as colloids, do not significantly affect the conductivity of a solution so a TDS meter does not include them in its reading.

So I bought a TDS Meter from ebay and it’s a cheap one







I tried to hack on it in order to get the output readings and interface them to an Arduino board. However, I couldn’t locate the output readings because I faced some problems with this IC which was completely new for me. I couldn’t identify either its model or its number

This are the front and the back pictures of TDS meter after being hacked . However, I couldn't find the output of the IC so can anyone help regarding this issue? and thanks.





So do you guys have any suggestions of what I am supposed to do in order to locate the place of the output and interface it with the Arduino board ?

Thanks in advance.
Pages: [1]