Shop OBEX P1 Docs P2 Docs Learn Events
Pink UDP questions — Parallax Forums

Pink UDP questions

JohnR2010JohnR2010 Posts: 431
edited 2010-01-04 22:42 in Propeller 1
I’m using the Parallax Internet NetBurner Kit (#30013) PINK with my SPIN processor to send UDP commands to an appliance that monitors our solar system.· The appliance, a SMA Webbox (in case you’re interested) expects UDP commands in JSON format and I’m running into a couple of challenges.· The JSON format requires several characters to be formatted correctly, ·the command I need to send is 72 ASCI characters long too big to fit in the PINK’s 64 byte UDP packet field.· Question: is there a way to increase this field size (UDP data field !NBOwBM)?· The appliance will not allow me to break up the command into two packets from what I can tell.
·
The second obstacle is my appliance is sending the response back to me in UNICODE format instead of ASCII.· SMA is an international company supporting several languages so I understand why they do this but man does it cause the PINK to go crazy.· ·According to my protocol analyzer the Pink is being sent a Unicode responses that appear as a character and then a null byte ($00) for every letter of the response.· So to the PINK it thinks it just received a 0 terminated string of 1 character in size.· Therefore I only receive the first character of the response. ··Since an ASCII “A” Dec 65 Hex $41 appears as $0041 in Unicode format the PINK stops receiving data into its UDP field ·after it receives the first character.·
Question: Is there a way the PINK can be told to receive Unicode text over UDP?· If not is there a way I can tell the PINK to ignore the “00” Null byte and receive all data in the UDP packet?
·
If the answer is I’m just out of luck and the PINK isn’t going to do it for me has anyone flashed the PINK back to its original OS from Net Burner?· I wonder if I could make it work then?
·
Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-30 22:54
    There's no way to increase the field size and UDP can't be broken up into multiple packets. The PINK's design predates widespread use of Unicode, so there's no support for that. Unfortunately, you're trying to make significant use of UDP when the PINK is really designed as a webserver that can incorporate simple string data for a Stamp. It happens to work with a Propeller, but the design is intended to support a simple microcontroller with limited string handling capability and very limited variable storage (the Stamps).

    You might consider using a YBox2 which is a Propeller with an open-source TCP/IP stack and Ethernet interface. It can act as a webserver, but can also upload and download programs, serve up data, etc.

    www.ladyada.net/make/ybox2/
    www.deepdarc.com/ybox2

    A lot of the I/O pins are available and you can make piggy-back boards. I have one and added an SPI 2MByte flash memory and 32K of SPI SRAM. It has a built-in TV interface and I plan to add a PS/2 keyboard as well for a stand-alone package. It only has a 3.3V regulator, no 5V regulator, and PS/2 requires a 5V source, so I'll have to add a small boost regulator for the keyboard.
  • JohnR2010JohnR2010 Posts: 431
    edited 2009-11-30 23:14
    Thanks Mike for the quick response! I don’t need all the bells and whistles of the YBOX2 looks like a very cool project for down the road.
    I’m now looking into a B&B electronics serial server I have here in the shop. It may do the trick, but I can’t tell from the documentation if it is has true RS232 or TTL level singles. Guess its time to get the old scope out.

    Any thoughts on flashing the PINK back to the NetBurner OS? Wonder if that is possible.

    Thanks again!
  • JohnR2010JohnR2010 Posts: 431
    edited 2010-01-04 22:42
    I have been successful in communicating with my SMA Webbox and I’m driving a servo based on how much power my solar array is receiving works very well!!· I got all this work by setting aside my PINK and hooked the propeller to the serial interface of the B&B Electronics ESR901WB serial to Ethernet server.· This allows me to send my UDP command in JSON format and receive the response all with double byte UNICODE characters.· Works great but!!
    ·
    I need the features of the PINK, the web interface and ability to determine the devices IP address etc.· The PINK gets me 90% their!· I just need to modifications to the firmware:
    1)····· Increase the packet size of a UDP packet from 72 bytes to 200 bytes or more.
    2)····· Allow me to set the terminating character of the UDP packet data.· The current PINK firmware uses the null byte ($00) to end a string.· I need to send a null between each character since I’m sending UNICODE.· Let me set it to something else.
    Here is my question:· Does anyone know who wrote the firmware for the PINK?· The PINK looks a lot like SB70 from NetBurner with some very clever code.· Truly it does everything I need except the above two modifications. ·I would like to know if I could get this code and make my modifications or work with the author to make them for me.
    ·
    Thanks!
Sign In or Register to comment.