Propeller Problems


#1

My new propeller hat has arrived and is sitting atop a B+. I installed p1 using
sudo pip install p1
That went well. But
sudo python -im p1.pwm
Gives:
Setting up Propeller HAT
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/usr/local/lib/python2.7/dist-packages/p1/pwm.py”, line 10, in
l.upload(code=’’.join(map(chr,binary)),progress=p1.loader.print_status)
File “/usr/local/lib/python2.7/dist-packages/p1/loader.py”, line 160, in upload
version = self._connect()
File “/usr/local/lib/python2.7/dist-packages/p1/loader.py”, line 264, in _connect
if self._read_bit(False, 0.100) != seq[i]:
File “/usr/local/lib/python2.7/dist-packages/p1/loader.py”, line 379, in _read_bit
raise LoaderError(“Timeout error”)
p1.loader.LoaderError: Timeout error

(I have disabled the serial console)

I would like to simply load spin binary files using p1load without installing the IDE. (I have experience with propellers in other contexts) I tried using the install program but it requires all sorts of IDE files that don’t interest me.

Is there a quick way to get p1load working? And why the timeout error?

Thanks!!!


#2

Ahoy!

Try grabbing the loader binary from here and running it as root to see what happens: https://github.com/pimoroni/propeller-hat/tree/master/software/p1load

I haven’t got a B+ to hand to see if I can replicate your problem, but I almost always found I’d somehow left my serial console enabled when encountering this error. It’s worth double checking!

The Python library uses a pure Python loader which I think might be on the cusp of unreliability depending on the speed/workload of your Pi.

I’m going to set aside some time for re-testing and documenting the Propeller loader process and, hopefully, building a new version of the IDE soon. I’d really like it to be a smooth process for users!


#3

Thanks for the quick reply. I checked /etc/inittab and the respawn ttyAMA0 is, in fact, commented out. To double-check, I hooked up a console cable and got nothing so I’m (relatively) confident that the serial console is disabled.

I downloaded p1load as you suggest and got the following:

$ ./p1load blink.binary
(LOW).
Failed to open export for writing!
Failed to open gpio17 for writing!
Failed to open gpio17 direction for writing!
error: can’t find a port with a propeller chip

The timeout error persists using python.

Any chance that the board is defective?


#4

Thanks for double-checking! Make sure you run p1load as root, also:

sudo ./p1load blink.binary

If you get a message like “Failed to open gpio17 for writing!” then the reset pin isn’t being toggled, which is absolutely essential for establishing communication.

It’s certainly possible that it’s defective, but it’s such a simple board with such a straight forward chip package that it’s very unlikely. Flip it over and have a look at the legs of the chip ( or get a good photo if you can ) to see if it’s obviously bridged or unsoldered anywhere.


#5

Duh! How stupid to have forgotten sudo. Alas:

sudo ./p1load blink.binary
(LOW).
Failed to write gpio17!
error: can’t find a port with a propeller chip

The chip soldering looks impeccable. I’d attach a pic but get an error message that says new users can’t upload images. :(


#6

Darnit. Out of interest, try running that command a few times in quick succession ( if you haven’t already ).

I think I need to get a B+ set up and see if I can get a similar problem so I can diagnose a little less blindly.

As a final attempt, for now, try grabbing this loader:

wget http://get.pimoroni.com/propeller-load
chmod +x propeller-load
udo ./propeller-load -Dreset=gpio,17,low -P

#7

Running p1load several times quickly didn’t help.

$ sudo ./propeller-load -Dreset=gpio,17,low -P
Using GPIO pin 17 as Propeller reset (LOW).

I swapper the Propeller Hat for my beloved Explorer Pro Hat on an A+, but got the same behavior.


#8

I’ve got my Propeller HAT set up and am in the process of trying to re-create your problem. It could very well be that you have a dodgy Propeller HAT that we’ll need to replace but I’m updating my Pi to see if anything breaks before I draw any conclusions!

  • update 1: …well … err… whatdya know, by enabling and disabling Serial in Raspi Config I appear to have run into the same problem!
  • update 2: false alarm I was just being stupid.

#9

Thanks for pushing ahead with this.


#10

Any progress? Options seem to be:

  1. doesn’t like the B+ (unlikely)
  2. defective board (likely)
  3. operator error (likely)

I’m happy to continue to exploring option 3, though I don’t know what else I could try.


#11

I think it’s possibly a defective board- or at least I’ve totally exhausted all my ideas for debugging, so it’s probably safe to assume.

Can you drop us an email to support with your order details so we can get a replacement sent out, and we’d love to get the faulty one back so we can figure out why it’s not working and avoid it happening again.

Cheers, and sorry this has been a big kerfuffle!