PLAManiac
Загрузка
02.05.2022
1597
Прошу помощи с подключением акселерометра adxl345. Прошивка не видит его. Одноплатник Rock Pi 4. ОС: Debian 10 buster. Плата управления SKR 1.3. Все устанавливал по инструкции с сайта https://www.klipper3d.org/Measuring_Resonance. Все необходимые пакеты установлены. Правильность подключения пинов gpio одноплатника и выводов акселерометра десятикратно проверена. Провод 50 см dupont. Команда терминала ls /dev/spi* выводит /dev/spidev2.0, т.е. spi шина включена. В веб интерфейсе fluidd прошивка выдаёт ошибку: mcu ‘rpi’ shutdown: Unable to open spi device. Акселерометры(2 шт.) покупал на АлиЭкспресс. Возможно дохлые, но сомнительно, чтобы сразу два. Проверить их больше не на чем. Может еще есть какие нюансы, может что то забыл сделать, подскажите пожалуйста. Очень хочется на своей дельте резонансы убрать.
Ответы на вопросы
Популярные вопросы
Помогите, я уже вообще не пойму…
Кто знает в чем может быть причина, ось Z в любом случае уходит вниз. G-code поставил другой с сайта, с этого… хотя даже вот
Начало…
Держатель катушки филамента.
vadimxg
Загрузка
20.01.2023
1229
Ребята, привет!
Какая самая удобная на ваш взгляд модель держателя катушки филамента? Можете ссылку на самую удобную модель показать?…
Кубик, Simplify3D и мосты
ZhenyaKa
Загрузка
01.12.2016
14793
slic3r перед тем, как выкладывать верхние слои, кладет мосты, а прекрасный Simpli3D этого не делает
То есть вот это зелено…
Читайте в блогах
I’m trying to run a C-program via html.
I’m using Raspberry Pi B and PiFace Difgital I/O (1).
I use a html.index, piface-blink.php and the C-program piface-blink.c
When I run the c-progam it access OK and blinc the LED at PiFace.
When I try to run i through a web I get this error message in /var/log/apache2/error.log:
Unable to open SPI device: Permission denied
This is what I have done so far:
pi@Cisero ~ $ uname -a
Linux Cisero 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l GNU/LinuxAccess through web, http://cisero_wifi/check/
I have opened SPI by raspi-config.
pi@Cisero ~ $ tail /var/log/apache2/error.log
Unable to open SPI device: Permission denied
[Wed Apr 08 07:48:12 2015] [notice] caught SIGTERM, shutting down
[Wed Apr 08 07:48:14 2015] [notice] Apache/2.2.22 (Debian) PHP/5.4.39-0+deb7u2 configured — resuming normal operations
[Wed Apr 08 07:50:34 2015] [notice] caught SIGTERM, shutting down
[Wed Apr 08 07:50:35 2015] [notice] Apache/2.2.22 (Debian) PHP/5.4.39-0+deb7u2 configured — resuming normal operations
Unable to open SPI device: Permission denied
[Wed Apr 08 08:02:25 2015] [notice] caught SIGTERM, shutting down
[Wed Apr 08 08:02:45 2015] [notice] Apache/2.2.22 (Debian) PHP/5.4.39-0+deb7u2 configured — resuming normal operations
Unable to open SPI device: Permission denied
Unable to open SPI device: Permission deniedpi@Cisero /var/www/check $ ls -l
totalt 24
-rwxr-xr-x 1 pi pi 903 apr 8 06:23 index.html
-rwxr-xr-x 1 pi pi 7079 apr 8 06:28 piface-blink-2
-rw-r—r— 1 pi pi 1452 apr 8 06:28 piface-blink-2.c
-rwxrwxrwx 1 pi pi 1340 apr 8 07:28 piface-blink.phppi@Cisero /var/www/check $ ./piface-blink-2 1
argc=2
buf=1LED nbr 7 blinking
pi@Cisero /etc $ sudo more sudoers
#
# This file MUST be edited with the ‘visudo’ command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path=»/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin»# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL# See sudoers(5) for more information on «#include» directives:
#includedir /etc/sudoers.d
pi ALL=(ALL) NOPASSWD: ALL
www-data ALL=(ALL) NOPASSWD: ALLpi@Cisero /etc/sudoers.d $ ls -l
totalt 8
-r—r—— 1 root root 958 mar 3 2013 README
-r—r—— 1 root root 155 apr 8 07:21 www-data
pi@Cisero /etc/sudoers.d $ sudo more www-data
#/etc/sudoers.d/www-data
#
# sudoers file for the www-data user — very limited permissions onlywww-data ALL=NOPASSWD: /var/www/piface/piface-blink
here are the programs:
index.html
Code: Select all
<!DOCTYPE html>
<html lang="sv">
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<title>Kör Piface-blink</title>
<meta name="generator" content="Bluefish 2.2.4" >
<meta name="CREATED" content="20140611;5273800">
<meta name="CHANGED" content="2015-04-08">
<meta name="DESCRIPTION" content="Testsida för att prova ,testa funktioner">
<meta name="KEYWORDS" content="Testsida">
</head>
<body>
<h1>Test av köra piface-blink</h1>
<p>Programnamn = piface-blink.php.</p>
<form method="POST" action="piface-blink.php">
<form action="piface" metod="POST">
<input type="checkbox" name="val" value="7">Blinka 7 LEDS
<br />
<input type="checkbox" name="val" value="1">Blinka 1 LED
<br />
<input type="submit" value="SKICKA">
</form>
<form metod="POST" action="index.html">
<input type="submit" value="RESET">
</form>
</body>
</html>
piface-blink.php
Code: Select all
<?php
/*
* piface-blink.php
*
* Copyright 2015 Jan Pihlgren
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
if($_SERVER['REQUEST_METHOD'] == "POST") {
echo "Testmeddelande";
echo "<br />";
echo $_SERVER['REQUEST_METHOD'];
echo "<br />";
echo $_POST['val'];
echo "<br />";
$val = $_POST['val'];
echo "val = ", $val;
echo "<br />";
}
$command="./piface-blink-2 {$val} &";
echo "command = ", $command;
echo "<br />";
exec($command);
exec('exit');
echo "<br>";
echo "Programmet klart!n";
echo "<br>";
?>
<html>
<body>
<form method="POST" action="index.html">
<input type="submit" value="TILLBAKA">
</form>
</body>
</html>
piface-blink-2.c
Code: Select all
/* programnamn: piface-blink-2.c
* Jan Pihlgren 2015-04-02
* Kompilera med:
* gcc -L/usr/local/lib -lwiringPi -lwiringPiDev -o piface-blink-2 piface-blink-2.c
*/
#include <stdio.h>
#include <string.h>
#include <wiringPi.h>
#include <piFace.h>
// Use 200 as the pin-base for the PiFace board, and pick a pin
// for the LED that's not connected to a relay
#define PIFACE 200
#define LED (PIFACE+2)
int main(int argc, char *argv[])
{
// Always initialise wiringPi. Use wiringPiSys() if you don't need
// (or want) to run as root
wiringPiSetupSys () ;
// Setup the PiFace board
piFaceSetup (PIFACE) ;
char buf[10]="";
int val=0;
int i;
if(argc > 1) {
strcpy(buf,argv[1]); // Kopiera argv[] till buf
}
printf("argc=%dn",argc);
printf("buf=%sn",buf);
val=atoi(buf); // Omvandla char to int
switch(val){
case 0:
break;
case 1:
blink1();
break;
case 2:
blink7();
break;
case 7:
blink7();
break;
default:
return 0;
}
return 0 ;
}
blink1()
{
int i;
// printf("buf=%sn",buf);
for(i=0;i<7;i++){
digitalWrite(LED+5, 1);
delay(100);
digitalWrite(LED+5, 0);
delay(100);
}
}
blink7()
{
int i;
// printf("Blinkan");
for (i=0;i<=7;i++){
digitalWrite(i+LED, 1);
delay(100);
digitalWrite(i+LED, 0);
digitalWrite(i+1+LED, 1);
delay(100);
digitalWrite(i+1+LED, 0);
}
return;
}
My question:
What else do I have to do or what does I had done wrong?
Edit:
For some reason I don’t understand the program begun running with success.
Last edited by janpihlgren on Wed Apr 08, 2015 10:37 am, edited 2 times in total.
klippy.log
image: bone-debian-8.7-iot-armhf-2017-03-19-4gb
replicape: B3A
From a fresh install I can get octoprint and klipper talking and can see what look to be accurate temps. Every time I get to the step «M112» the system will not recover. I have of course entered «FIRMWARE_RESTART» but am met with T:0 and a status reply of
Recv: // MCU ‘host’ error during config: Unable to open spi device
Recv: // Once the underlying issue is corrected, use the
Recv: // «FIRMWARE_RESTART» command to reset the firmware, reload the
Recv: // config, and restart the host software.
Recv: !! Error configuring printer
I have had this same hardware running on klipper with ramps prior. I have the onboard flashed with redeem and can boot into klipper at any time to test. Would love to cut over to klipper as I am really struggling to get good prints out of redeem.
On Tue, Feb 20, 2018 at 06:56:29PM +0000, ifUpEth0 wrote:
image: bone-debian-8.7-iot-armhf-2017-03-19-4gb
replicape: B3A
From a fresh install I can get octoprint and klipper talking and can see what look to be accurate temps. Every time I get to the step «M112» the system will not recover. I have of course entered «FIRMWARE_RESTART» but am met with T:0 and a status reply of
Recv: // MCU ‘host’ error during config: Unable to open spi device
Recv: // Once the underlying issue is corrected, use the
Recv: // «FIRMWARE_RESTART» command to reset the firmware, reload the
Recv: // config, and restart the host software.
Recv: !! Error configuring printer
That’s odd. What does ‘ls -l /dev/spidev*’ report? There should be
an spi device created by the OS.
…
ls -l /dev/spidev* gives error. It would seem the spi device is missing. I see nothing like it in /dev.
I can try a new snapshot but when I tried bone-debian-9.3-iot-armhf-2018-01-28-4gb I could never get past the «/dev/rpmsg_pru30» error mentioned above.
the spi tip helped. Should anyone else end up here. Check /boot/uEnv.txt.
You probably need the following:
cape_disable=bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0,BB-SPIDEV1
After this and a reboot I again have my temps and can M112 and FIRMWARE_RESTART as expect.
On Tue, Feb 20, 2018 at 11:51:38PM +0000, ifUpEth0 wrote:
the spi tip helped. Should anyone else end up here. Check /boot/uEnv.txt.
You probably need the following:
cape_disable=bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0,BB-SPIDEV1
After this and a reboot I again have my temps and can M112 and FIRMWARE_RESTART as expect.
The «cape manager» stuff on the beaglebone is a complete nightmare.
I suspect issue #183 is a similar (but different) mysterious problem
with the cape manager.
…
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.