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
Python problem
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: Python problem
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.
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.
-
- Posts: 5
- Joined: Mon Nov 30, 2015 6:25 pm
Re: Python problem
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.
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.
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: Python problem
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
-
- Posts: 5
- Joined: Mon Nov 30, 2015 6:25 pm
Re: Python problem
Hey Nils,
sorry for the late reply, but I just wanted to say thanks for your help.
Everything worked fine now.
sorry for the late reply, but I just wanted to say thanks for your help.
Everything worked fine now.
-
- Posts: 1
- Joined: Fri Oct 26, 2018 1:54 pm
Re: Python problem
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
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
-
- Posts: 1
- Joined: Thu Dec 27, 2018 1:58 pm
Re: Python problem
Hey,
I was also getting some error in the python. I want to learn python Can anyone tell me where can I get a good knowledge of python. please suggest.
Thank you!
I was also getting some error in the python. I want to learn python Can anyone tell me where can I get a good knowledge of python. please suggest.
Thank you!
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: Google [Bot] and 33 guests