element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum py-spidev mod help
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 663 subscribers
  • Views 455 views
  • Users 0 members are here
  • raspberry
  • python
  • spidev
  • raspberry_pi
  • mpc3002
  • gertboard
Related

py-spidev mod help

Former Member
Former Member over 10 years ago


Helllo community,

 

I want to use the ADC on the Gerdboard. I started with the example code, witch was mentioned in the book "Raspberry Pi - Das umfassende Handbuch"
The code looks like this:
import spidev

import time

spi = spidev.SpiDev()

spi.open(0,1)

while True:

     antwort = spi.xfer([1,128,0])

     if 0 <= antwort[1] <=3:

          wert = ((antwort[1] * 256) + antwort[2]) * 0.00322

          print wert, " V"

          time.sleep(1)

 

Pretty easy, but I got the ErrorMessage: typeError Argument must be a list of at least one, but not more than 4096 integers

 

I found an answer here: https://www.raspberrypi.org/forums/viewtopic.php?p=309582
My problem is now about to change the file. I have no writing-rights.

This problem could not be solved by the chmod "bufsiz" command.

I was allowed to change the file as I loged in with the sudo su superuser, but the change was removed after a reboot and a login with the normal user "pi-raspberry".

 

Do you think changing bufsiz is the right way and can you help me changing it permanently?

 

 

Thank you
Sebastian

 

 

  • Sign in to reply
  • Cancel
  • clem57
    0 clem57 over 10 years ago

    For the file in question just do this:

    sudo chmod +777 myfile.xxx

    man chmod      for more help

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago

    Command works but after a reboot it's like i never changed it.(4096)..
    Same Error with the gertboard "dad" example btw. ...

    Errors occurs even when the file is changed (so no reboot was done and the command cat "bufsiz" shows correctly "65536",
    i also addet options spidev bufsiz=65536 to etc/modprobe.d/local.conf but it has no effects

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to Former Member

    I had a similar problem and I could solve it with help of SPI-Schnittstelle...HILFE.

    It seems to be of problem of different software versions. Perhaps these commands may help.

     

    sudo pip uninstall spidev

    sudo pip install spidev

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube