Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

My raspberry pi is so slow i cannot connect it - why

Volvo742
2016-06-26
2016-06-27
  • Volvo742 - 2016-06-26

    Hello.

    I have just made a program in Codesys and i upload it and everything works perfect!

    But then when i was editing the code in Codesys and try to upload, i can't find my PI. I try to plug it into the TV but a can only se the wall of linux text and the text disapear when i just see the login in terminal mode. After that the TV screen is blank black. But the TV does not say "no connection".

    What is wrong with my PI? Have Codesys made so it won't start due to cpu usage?

    Edit: Now something happening. I could login almost. It's really slow

    Zitat:
    Raspbian GNU/Linux 8 raspberry tty4
    raspberry login: pi
    Password: (raspberry)
    Login time out after 60 seconds

    Edit 2:

    Im in the terminal now. Really slow. I can see the text moving down.

    I have write the command.
    Sudo /etc/init.d/codesyscontrol stop

    It stops.

    Edit 3:
    I removed all *.app file from./room to /root/junk as temp file.

    I can start X Now. I can find my device, but my PI is slow. It taket minutes to login.

    Edit 4:
    But now i can't find my PI in Codesys. So slow.

     
  • eschwellinger

    eschwellinger - 2016-06-26

    Hi,

    please check the system load by 'top'

    BR
    Edwin

     
  • Volvo742 - 2016-06-26

    Edwin Schwellinger hat geschrieben:
    Hi,
    please check the system load by 'top'
    BR
    Edwin

    The codesyscontrol takes about 90-99 CPU usage. I have tried to reinstalling codesyscontrol but its the same story.

    It's looks like i have made to heavy code. But is that possible? I only have tree programs.

    I have uploaded my project. The comments is on Swedish, but you only need to run this without wire any anything to the bredboard.

    Styrsystem.rar [385.21 KiB]

     
  • eschwellinger

    eschwellinger - 2016-06-27

    Hi,

    guess this while loop seems to be the problem.

    Login to the raspberry pi,
    then
    sudo -s
    cd /root/
    rm App*

    in case your Application is in /root/PlcLogic
    rm /root/PlcLogic/App*

    this will solve the problem with the load. (Sure on next download with your programm it is back again)

    If you want to prevent situations like this you could either enable processorload supervision by adding
    the following section to /etc/CODESYSControl.cfg

    [CmpSchedule]
    ProcessorLoad.Enable=1
    ProcessorLoad.Maximum=95

    or you could disable Implicit generate bootapplication see screenshot.

    Some remarks to your application, why not using the Example application for MCP3008?
    There is an ready to use Projektexample for SPI and MCP3008
    "c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\3.5.8.10\Examples\MCP3008Temperature.project"
    If this is not what you Need you could either adapt this SPI Driver or use:
    "c:\Users\<wnidowsusername>\CODESYS Control for Raspberry PI\3.5.8.10\Examples\PiFace_FB.project" which should show how to use SPI from the application code. </wnidowsusername></yourwindowsusername>

    BR
    Edwin

    IMG: ImplicitBootproject.jpg

    IMG: MCP3008.jpg

     
  • Volvo742 - 2016-06-27

    Hello! So i need to remove the while loop in BIN_TO_DEC function?

    I will try with disable that.

    The reason i have made my own SPI is beacuse i dont know how to develope own libraries. Beacuse i want to make libraries who run in the background. And the libraries parameter can be changed while the PLC runs. There is no tutorial for that.

     
  • Volvo742 - 2016-06-27

    I fix'd it. Just increase the cycles.

     
  • eschwellinger

    eschwellinger - 2016-06-27

    Hi,

    'do not want to develop own libraries'

    then use this example, this is without develop an own library just use the spi master from the project/application:

    c:\Users\<wnidowsusername>\CODESYS Control for Raspberry PI\3.5.8.10\Examples\PiFace_FB.project</wnidowsusername>

    BR
    Edwin

     
  • Volvo742 - 2016-06-27

    Edwin Schwellinger hat geschrieben:
    Hi,
    then use this example:
    c:\Users\<wnidowsusername>\CODESYS Control for Raspberry PI\3.5.8.10\Examples\PiFace_FB.project
    BR
    Edwin</wnidowsusername>

    I said 'i dont know how to develop own libraries'. Not 'do not want to develop own libraries '

     

Log in to post a comment.