public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: Gary Thomas <gthomas@cambridge.redhat.com>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Redboot: [xyz]modem via TCP?
Date: Fri, 09 Feb 2001 07:24:00 -0000	[thread overview]
Message-ID: <20010209092810.A3808@visi.com> (raw)
In-Reply-To: <XFMail.20010209062910.gthomas@cambridge.redhat.com>

On Fri, Feb 09, 2001 at 06:29:10AM -0700, Gary Thomas wrote:

> >> With Redboot, can you do [xyz]modem download via TCP instead of
> >> serial port?
> > 
> > I slapped together a Python program that uses "sx" to download
> > an S record file via TCP using xmodem protocol.  Small files
> > (less than 2K or so) work fine, but when I get up to about 2K,
> > RedBoot crashes.  I can load the large files fine via TFTP and
> > xmodem/serial.
> > 
> > Anybody else see anything like this?
> 
> I've not tried this.  If you want to share [only with me if necessary]
> the Python program, I'll give it a look-see when I get a chance.

Thanks. 

Here it is.  I didn't try any variations on protocol/frame-size
or anything.  Just the defualt x-modem mode. IP addresse and
filename are hard-coded...

========================================================================
import time
import socket
import os
import sys

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.1.21',9000))

print "connected to: ",s.getpeername()," from ",s.getsockname()

r = s.recv(1024)

print "received: ",r

if not r.startswith("RedBoot"):
    raise "No answer from RedBoot"

s.send("load -m x\r")

r = s.recv(1024)
print  "received: ",r

fd = s.fileno()
os.dup2(fd,0)
os.dup2(fd,1)

os.spawnv(os.P_WAIT,"/usr/bin/sx",("/usr/sbin/sx","-v","dataFile.srec"))

sys.stderr.write("done\n");
s.close()
========================================================================

-- 
Grant Edwards
grante@visi.com

  reply	other threads:[~2001-02-09  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-06 11:37 Grant Edwards
2001-02-08 14:29 ` Grant Edwards
2001-02-09  5:29   ` Gary Thomas
2001-02-09  7:24     ` Grant Edwards [this message]
2001-02-09 10:36     ` Grant Edwards
2001-04-18 11:02   ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010209092810.A3808@visi.com \
    --to=grante@visi.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=gthomas@cambridge.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).