Python problem

Applications, development tools, FPGA, C, WEB
Post Reply
dires
Posts: 5
Joined: Mon Nov 30, 2015 6:25 pm

Python problem

Post by dires » Mon Nov 30, 2015 6:35 pm

Hi everyone,

I'm trying to get the simple blink example in python to work.
I saved the code into the new file /root/examples/blink.py and made it executable.
But I got an import error for the redpitaya_scpi. (ImportError: No module named redpitaya_scpi)

I then found the github folder Link and also copied the file "redpitaya_scpi.py" to the folder /root/examples/.

Then I got a different error in line 11. (IndexError: list index out of range)

I'm totally new to Redpitaya, so can you please help a newbie? :)

Thanks in advance.

Best regards
Sven

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Python problem

Post by Nils Roos » Mon Nov 30, 2015 10:05 pm

If I had to guess, you ommitted the ip address on the command line. All the python examples need at least the Red Pitaya's address as an argument. That's because they all try to connect to the scpi-server running on the Red Pitaya.

To pre-empt the most likely problem you'll encounter next, the scpi-server is not started automatically when booting, you will have to connect to the Red Pitaya and start it by hand (see here for more details).

edit: In case you are trying to run the python examples on the Red Pitaya, you can just use 127.0.0.1 as address. But you still need to start the scpi-server first.

dires
Posts: 5
Joined: Mon Nov 30, 2015 6:25 pm

Re: Python problem

Post by dires » Mon Nov 30, 2015 10:46 pm

Thanks a lot for your answer.

I did start the server by hand, as it is stated in the tutorial. And I tried to run the python example on the pitaya.

What would the command line exemplarily look like, to start the code while ommitting the ip address?

Thanks again. :)

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Python problem

Post by Nils Roos » Mon Nov 30, 2015 10:52 pm

The address is required - if you leave it out, you'll get the 'list index out of range' error. The command would be:

Code: Select all

./blink.py 127.0.0.1

dires
Posts: 5
Joined: Mon Nov 30, 2015 6:25 pm

Re: Python problem

Post by dires » Wed Dec 09, 2015 12:07 am

Hey Nils,

sorry for the late reply, but I just wanted to say thanks for your help. :)
Everything worked fine now. ;)

chris2121
Posts: 1
Joined: Fri Oct 26, 2018 1:54 pm

Re: Python problem

Post by chris2121 » Fri Oct 26, 2018 2:05 pm

Hello Everyone,

If you want to improve your programming skill as well as your concepts. You need to just through with the Python Tutorial. It helped me a lot. I suggest you to go through with this link.

Thanks

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 3 guests