使用RaspBerry Pi和我的计算机,我正在尝试交叉编译一个用C++编写的简单helloWorld.我正在使用Code Sourcery工具链进行linux编译.
通过TFTP将helloWorld二进制文件复制到raspBerry并使用chmod赋予它执行权限时,会出现下一个错误:
"非法指导"
如果在二进制文件上创建'文件',我会得到:"raspberry:ELF 32位LSB可执行文件,ARM,版本1(SYSV),静态链接,剥离"
这是因为我在链接时使用了"-static -static-libstdc ++".
如果我不使用静态链接,则错误为:"分段错误"
代码:
/*
* main.cpp
*
* Created on: 26/06/2012
* Author: ccortiz
*/
#include <iostream>
using namespace std;
int main(void){
cout << "Hello Cross Compilling for ARM!" << endl << flush;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我怎么能以正确的方式编译和运行我的程序?谢谢.
现在我得到了我的Raspberry Pi.我是一位经验丰富的应用软件开发人员,但我以前从未做过硬件或低级编程.我想构建一个最小的Linux,包括我的Pi上所有硬件的驱动程序.出于学习目的,我不想在我的Pi上安装任何预先构建的Linux发行版.我应该从哪里开始?
我有一个我通过SSH访问的Raspberry pi,但现在我需要在它上面运行一个带有GUI的python程序.我不知道如何通过SSH做到这一点.通常我输入startx来到我的raspi桌面gui.在ssh上有什么我能这样做的吗?
谢谢!
我试图检测我的iPhone是否与我的Raspberry Pi在同一网络中.我想在家里执行脚本,我的iPhone在我的局域网中注册.
似乎当手机处于待机状态时,甚至找不到iphone同步端口(6207/tcp)."/ usr/bin/nmap -n -sT -p62078 [我的手机的本地IP]"显示没有主机.我想知道还有什么我可以扫描的.显然,手机处于在线状态并准备接受正面通话(通过3G停用的数据).我可以用我在Raspberry Pi上使用的avahi来完成某些事情,或者还有其他方法.
怎么加ctr0.o?
我收到此错误:
yagarto-4.7.2/bin/arm-none-eabi-ld: cannot find crt0.o: No such file or directory
collect2: error: ld returned 1 exit status`
Run Code Online (Sandbox Code Playgroud)
从这里编译非常简单的程序:
/* -- first.s */
/* This is a comment */
.global main /* 'main' is our entry point and must be global */
.func main /* 'main' is a function */
main: /* This is main */
mov r0, #2 /* Put a 2 inside the register r0 */
bx lr /* Return from main */
Run Code Online (Sandbox Code Playgroud)
我看过这两个帖子并没有得到任何完整和直截了当的答案: …
我在Valgrind测试我的应用程序,我无法理解为什么它会在这里抛出无法识别的指令错误:
unsigned char *temp=SearchStartPtr;
unsigned char *NrStartPos=NULL;
unsigned char *Param=(unsigned char*)ParamName; //this is originally *char with "PAR#" inside
if(0==memcmp(temp,Param,4))
{
NrStartPos=temp;
break;
}
Run Code Online (Sandbox Code Playgroud)
Valgrind抛出这个并退出我的应用程序.
disInstr(arm): unhandled instruction: 0xF1010200
cond=15(0xF) 27:20=16(0x10) 4:4=0 3:0=0(0x0)
==7679== valgrind: Unrecognised instruction at address 0x4843588.
==7679== at 0x4843588: ??? (in /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so)
Your program just tried to execute an instruction that Valgrind
==7679== did not recognise. There are two possible reasons for this.
==7679== 1. Your program has a bug and erroneously jumped to a non-code
==7679== …Run Code Online (Sandbox Code Playgroud) 我无法VideoWriter在Raspberry Pi(Raspbian Weezy)上实例化和打开用于录制视频的OpenCV .
我的项目是用C++编写的,但我编写了一个最小的Python程序来演示这个问题.
https://gist.github.com/chriscollins/11ff2f43852e1c93dae8
我的C++代码和上面的Python代码都在我的Windows机器上运行没有问题.有时候笔者不开,但是这是可以预料的-我没有安装所有列出的编解码器(编解码器的列表来自开放CV源),但相当多的人正常工作.然而,在Raspberry Pi上,C++代码和Python代码都失败了,VideoWriter永远不会被打开.在上面的Python代码中,writer.isOpened()当在Raspberry Pi上运行时,为每个编解码器返回false.
我已将chown目标目录编辑为我正在运行Python脚本的用户,并将chmod其设置为ded,777因此我不相信它是权限问题.我认为它可能与我如何安装OpenCV或其某些依赖项有关,但我不确定如何纠正它.
我使用的安装过程如下:
更新通过固件/包rpi-update,apt-get update和apt-get upgrade.
通过以下方式安装以下依赖项apt-get:
libjpeg8
libjpeg8-dev
libjpeg8-dbg
libjpeg-progs
ffmpeg
libavcodec-dev
libavcodec53
libavformat53
libavformat-dev
libgstreamer0.10-0-dbg
libgstreamer0.10-0
libgstreamer0.10-dev
libxine1-ffmpeg
libxine-dev
libxine1-bin
libunicap2
libunicap2-dev
swig
libv4l-0
libv4l-dev
python-numpy
libpython2.6
python-dev
python2.6-dev
libgtk2.0-dev
下载并解压缩http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip来/root/opencv-2.4.9.
cd /root/opencv-2.4.9并运行cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_ocl=OFF.可通过https://gist.github.com/chriscollins/d8060e03a6acd6d4336c获得cmake的输出
make并make …
如何配置我的Raspberry Pi 3(运行Raspbian)连接到隐藏网络?我知道它涉及编辑/ etc/network/interfaces文件和wpa_supplicant.conf文件.我已经遵循了一些其他指南,但是当我更改这些文件并重新启动时,我甚至无法检测到可见网络,因为它们从我的wifi菜单中消失了.我想我只是用不正确的配置编辑这些文件.
我们知道.NET Core支持Linux x64和x86,MacOS X,Windows ......但它是否可以在Linux中用于Raspberry Pi?(例如Raspbian).
我正在尝试在树莓派 4 中使用 flask_socketio、socketIO_client 和 SOCKET.IO 在 python 中运行客户端和服务器,但出现以下错误:
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
192.168.1.80 - - [05/Feb/2021 18:30:41] "GET /socket.io/?EIO=3&transport=polling&t=NTpTT-L HTTP/1.1" 400 219 0.000618
Run Code Online (Sandbox Code Playgroud)
这些是我当前的版本:
pi@raspberrypi:~/Desktop/EDAdataLogger $ npm list socket.io EDAdataLogger@ /home/pi/Desktop/EDAdataLogger ??? socket.io@3.1.1
pi@raspberrypi:~/Desktop/EDAdataLogger $ npm list socket.io-client EDAdataLogger@ /home/pi/Desktop/EDAdataLogger ??? socket.io-client@3.1.1
python-engineio==4.0.0
python-socketio==5.0.4
Flask==1.1.2
Flask-Session==0.3.2
Flask-SocketIO==5.0.1
Run Code Online (Sandbox Code Playgroud)
如何定义 JavaScript Socket.IO 版本和 Socket.IO 协议修订版,以便根据 ( https://pypi.org/project/python-socketio/ )匹配所有内容?
我怎样才能解决这个问题?谢谢