Shop OBEX P1 Docs P2 Docs Learn Events
XMODEM for the Prop - anyone done this? — Parallax Forums

XMODEM for the Prop - anyone done this?

Cluso99Cluso99 Posts: 18,069
edited 2010-02-23 13:18 in Propeller 1
Has anyone done Xmodem for the Prop?

If not, Drac, are you up to the challenge? I can put it to a SD FAT16/32 file quite easily, but you have done the protocol numerous times·before. So I guess, all I need is the protocol running and discard the data for now. Is it easy for the protocol to go either way?

I am thinking it could be a standalone binary stored on the SD and called from PropCmd/PropDos.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-01-01 18:23
    Here ya go..

    Part of it was already written(download), so I wrote the other half(upload)..

    No guarantees on how well it works, but it was tested with the N8VEM board and worked fine.

    OBC

    '' Xmodem Protocol Notes:    (Because someone will want to use it.)
    '' ----------------------
    '' The Xmodem Receive code was borrowed from Mike Cook's "sdxmodem.spin"
    '' (I believe it was originally used in "xmodemVGA_BMP.spin", but I can't
    '' tell where it originated, but Mike's version was very well commentted.
    ''
    '' The Xmodem Send code was created based on
    '' "Understanding The X-Modem File Transfer Protocol" by: Em Decay
    '' I tried to follow Mike's lead and comment it well.
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.

    Post Edited (Oldbitcollector) : 1/1/2010 6:39:22 PM GMT
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-01-01 19:06
    Thanks OBC. Another piece of the puzzle done smile.gif

    BTW, love the comments LOL

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • James LongJames Long Posts: 1,181
    edited 2010-01-01 19:52
    Oldbitcollector said...
    Here ya go..

    Part of it was already written(download), so I wrote the other half(upload)..

    No guarantees on how well it works, but it was tested with the N8VEM board and worked fine.

    OBC

    '' Xmodem Protocol Notes:    (Because someone will want to use it.)
    '' ----------------------
    '' The Xmodem Receive code was borrowed from Mike Cook's "sdxmodem.spin"
    '' (I believe it was originally used in "xmodemVGA_BMP.spin", but I can't
    '' tell where it originated, but Mike's version was very well commentted.
    ''
    '' The Xmodem Send code was created based on
    '' "Understanding The X-Modem File Transfer Protocol" by: Em Decay
    '' I tried to follow Mike's lead and comment it well.
    
    


    OBC,

    Would you put that in the OBEX?

    That is a very useful piece of code if it works. If it doesn't someone will find a bug and tell you.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-01-01 19:54
    I could but honestly only half of it was my code.

    Do you think the author of the other half would object?
    It looks like Mike Cook's work, but I can't be sure.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • RaymanRayman Posts: 14,877
    edited 2010-01-01 19:54
    I posted YMODEM code a long time ago. YMODEM is a lot better than XMODEM...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • James LongJames Long Posts: 1,181
    edited 2010-01-01 20:03
    Rayman said...
    I posted YMODEM code a long time ago. YMODEM is a lot better than XMODEM...

    Ray,

    I'm not saying one is better than the other. But there are some interfaces that use one or the other. Both would be nice when someone needs them.

    @OBC,

    Just make reference to the fact you used his code for the basis, and moved forward from there. I can't see where someone would be mad about another person finishing what he started.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-01-01 20:03
    Too True... Any chance we could twist your arm into Zmodem one day?

    The autostart feature would be worth it's weight in code gold.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-01-01 20:04
    @James:

    I'll clean it up a bit first... Maybe an original author will step up in the meantime.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • James LongJames Long Posts: 1,181
    edited 2010-01-01 20:16
    Just to clarify....

    I have a unit which uses XMODEM for field upgrades. I'm not sure what is compatible with it. I just figure if I use XMODEM, I can't go wrong.

    I have been needing XMODEM for a while, but didn't ever get around to doing it.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Mike CookMike Cook Posts: 829
    edited 2010-01-01 22:05
    I didn't originally write the XMODEM part, just modified it & over commented it so I could understand how it was working............notes from one of my programs

    Post away if it's useful.

      12-23-2007 - Started program template, used Simon Ampleman's XModem Wave
                   Player's XMODEM method. Original program wrote data to an I2C
                   EEPROM connected to PINs 0 & 1. Modified this routine to
                   receive a file from a MaxStream Xbee connected to PINs 4 & 5
                   and then store the file to a SD card using Tomas Rokicki's
                   FAT16 SD Support.
    


    I'll look to see if I can find a link to the original.


    <EDIT>

    </EDIT>

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    Post Edited (Mike Cook) : 1/1/2010 10:20:00 PM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-01-01 23:06
    I did write a ZMODEM protocol quite some time ago but I think there were still a few things that had to be finished off although it's mostly working. I'm really trying to find a lot of round tuits over this break so maybe I can use one of them, but only if you really need it, otherwise you already have X & Y smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • RaymanRayman Posts: 14,877
    edited 2010-01-02 00:25
    I don't remember too well, but I think Y and Z are almost the same, except that Z allows you to restart a download in case it fails midway...
    This was very useful when downloading via telephone line where the chances of an error were very high, but I think for the usual cases here, the changes of an error are very low. And, YMODEM will detect any errors, it just doesn't recover as well as Z...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-01-02 04:51
    Thanks Mike (Cook). We are moving on this now...

    Drac is a master of versions of Xmodem for CPM and Windoze VB. Any comments Drac?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-01-02 06:48
    Yes, I'm here, just busy at work suturing and pulling barbed wire out of people.

    I've got xmodem working in CP/M and on the PC in vb.net. Also, you can automate it so it can send many files - eg from the PC end it can' take over' the remote end and 'type' things in - eg xmodem errors if you try to save a file over a file with the same name, so the first thing the PC end does to the remote is 'type' in an erase. Xmodem times out too - so I think it is possible to replicate most of the ymodem/zmodem functions using xmodem.

    What I'm not sure is how xmodem works in spin. In CP/M you type something like 'xmodem r myfile' where r means 'receive' and myfile is the name. Then it sits and waits for a while expecting something to come through. (which it will if the PC end 'typed' that command to the serial port.) But with spin, how do you type such a thing in? It sort of implies you have more than spin, you have a keyboard and a display and an operating system, and basic terminal things like backspace and delete.

    I'll have a look at OBC's code as it might shed some light.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-01-02 07:08
    We have an OS sort of in PropCmd/PropDos and I have just extended it. It will boot ZiCog (working), or any other binary, program eeprom, DIR, DEL, etc. Now I would like to add in the Xmodem stuff.

    Really, what I would like is just as per CPM where it is a standalone program/object and loaded into the TPA and executed, the same as DIR etc are under CPM. However, we don't have a BIOS as yet (specs still tbd). This way we minimise the hub usage by not cluttering with commands that don't matter if they take a little longer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • James LongJames Long Posts: 1,181
    edited 2010-01-04 02:19
    Oldbitcollector said...
    Here ya go..

    Part of it was already written(download), so I wrote the other half(upload)..

    No guarantees on how well it works, but it was tested with the N8VEM board and worked fine.

    OBC

    '' Xmodem Protocol Notes:    (Because someone will want to use it.)
    '' ----------------------
    '' The Xmodem Receive code was borrowed from Mike Cook's "sdxmodem.spin"
    '' (I believe it was originally used in "xmodemVGA_BMP.spin", but I can't
    '' tell where it originated, but Mike's version was very well commentted.
    ''
    '' The Xmodem Send code was created based on
    '' "Understanding The X-Modem File Transfer Protocol" by: Em Decay
    '' I tried to follow Mike's lead and comment it well.
    
    

    ]

    OBC,

    Can I ask a question.

    I was looking at the Xmodem protocol, but can't see where the object uses a pointer for file reference. Is there a pointer?

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-01-04 02:27
    The file reference was "cfile" -- Have a look at this link to see
    how Xmodem was bring used in the terminal I wrote a while back.

    http://forums.parallax.com/attachment.php?attachmentid=58123

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • James LongJames Long Posts: 1,181
    edited 2010-01-04 02:59
    Oldbitcollector said...
    The file reference was "cfile" -- Have a look at this link to see
    how Xmodem was bring used in the terminal I wrote a while back.

    http://forums.parallax.com/attachment.php?attachmentid=58123

    OBC

    Yea....I caught that right after I posted........

    I think that will work.......

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-01-05 04:32
    I did write a ZMODEM protocol quite some time ago but I think there were still a few things that had to be finished off although it's mostly working. I'm really trying to find a lot of round tuits over this break so maybe I can use one of them, but only

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • EricREricR Posts: 35
    edited 2010-02-23 13:18
    I wrote a Kermit protocol for loading EEPROM wirelessly (or other transparent serial connection). See "Kermit EEPROM Console" under protocols in the Propeller Object Exchange.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Eric
Sign In or Register to comment.