Raspberry
文章平均质量分 86
feiwatson
这个作者很懒,什么都没留下…
展开
-
走马观花看ubuntu core 20
在树莓派4上安装了ubuntu core 20, 走马观花看看文件目录scp看到的根文件系统如下最明显的是多了一个snap. 这里是安装的snap包。包括如下子目录/snap/bin - Symlinks to snap applications./snap// - Mountpoint for snap content./snap//current - Symlink to current revision, if enabled.ssh登陆看到原创 2021-12-19 23:17:31 · 1075 阅读 · 0 评论 -
树莓派 Node Red
Node-RED目标:在树莓派上“零编程”快速搭建一个MQTT client 。简介官网https://nodered.org/简介* 基于浏览器的流编辑Node-RED提供了一个基于浏览器的流编辑器,可以使用调色板中广泛的节点轻松地将流连接到一起。然后,只需单击一次,就可以将流部署到运行时。可以使用文本编辑器在编辑器中创建JavaScript函数。内置库允许您保存有用的函数、模板或流以供重用.* 构建在Node.js之上构建在Node.js上的轻量级“运行”,充分利用了它的事件驱动、非阻原创 2021-11-17 21:59:50 · 2527 阅读 · 0 评论 -
树莓派 - gpio-led platform driver 控制LED
树莓派3b板上有两个LED, pwr (power) 和 act (activity)。是platform_driver gpio-led驱动。可以通过设备树和gpio-led来额外控制一个LED。如下图在P25和GND之间接入一个发光二极管。 在设备树bcm2710-rpi-3-b.dts中添加一个LED2来控制外部的LED&leds { act_led: act {...原创 2018-06-26 22:26:36 · 813 阅读 · 0 评论 -
树莓派 -- i2c学习 续(1) DeviceTree Overlay实例化rtc
上文中讨论了通过sysfs来实例化i2c设备 (rtc ds3231) https://blog.csdn.net/feiwatson/article/details/81048616本文继续看看如何通过 DeviceTree Overlays来实例化rtc ds3231write dts首先,写一个dts/dts-v1/;/plugin/;/ { co...原创 2018-07-16 22:17:14 · 2656 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key) 续1
测试 安装 input-utilspi@raspberrypi:~ $ sudo apt-get install input-utilsReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following NEW packages will ...原创 2018-07-04 22:47:25 · 374 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key) 续2: 转载 Setting up a GPIO-Button “keyboard” on a Raspberry Pi
使用device-tree (DT) overlay应该是更方便的方法:http://blog.gegg.us/2017/01/setting-up-a-gpio-button-keyboard-on-a-raspberry-pi/Back in late 2013, when I wrote the first Version of a raspberry-pi based softwa...转载 2018-07-04 23:07:03 · 502 阅读 · 0 评论 -
树莓派 -- i2c学习
硬件平台RaspberryPi-3B+Pioneer600外扩版i2c芯片为DS3231,adddress 0x68首先来看一下i2ctool的使用i2ctool 使用https://i2c.wiki.kernel.org/index.php/I2C_Tools https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-too...原创 2018-07-14 23:18:48 · 3036 阅读 · 0 评论 -
树莓派 -- oled
硬件SPI0,CE0 SPI Master Driver设备树arch\arm\boot\dts\bcm2710-rpi-3-b.dts&gpio { spi0_pins: spi0_pins { brcm,pins = <9 10 11>; brcm,function = <4>; /* a...原创 2018-07-21 20:57:11 · 1473 阅读 · 0 评论 -
树莓派 -- oled 续(1) wiringPi
在上文中,分析了wiringPi 的oled demo是使用devfs来控制spi master和spi slave通讯。 https://blog.csdn.net/feiwatson/article/details/81149028再详细分析一下demo的OLED SSD1306相关代码。定义一个bufferunsigned char buffer[1024];初始化vo...原创 2018-07-21 21:36:51 · 1160 阅读 · 0 评论 -
树莓派 -- oled 续(2) python
上文中的代码通过wiringPi的API调用devfs API来显示图片。 这里分析的Python代码也通过类似的方法来显示图片。主要用到了两个Library.import spidev import RPi.GPIO as GPIORPi.GPIO在 https://blog.csdn.net/feiwatson/article/details/80790340 大致分析了...原创 2018-07-22 16:34:41 · 749 阅读 · 0 评论 -
树梅派 -- 通过/sys读写ADC芯片 pcf8591
通过wiringPi等library, 在user space 通过/dev/i2c来读写i2c设备的方案不在本文讨论了。编译SENSORS_PCF8591 模块在Default raspberryPi的内核中,pcf591模块是没有编译的。查看drivers\hwmon\Makefileobj-$(CONFIG_HWMON) += hwmon.o...ob...原创 2018-07-31 15:06:07 · 524 阅读 · 0 评论 -
树莓派 - 蓝牙 (1) 试试Beacon
bluez安装 sudo apt-get install bluezhciconfig查看蓝牙设备pi@raspberrypi:~ $ hciconfighci0: Type: Primary Bus: UART BD Address: B8:27:EB:26:23:F1 ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNI...原创 2018-08-11 20:09:51 · 3552 阅读 · 0 评论 -
树莓派 - RasberryPi推送数据到cloudMQTT
创建用户在https://www.cloudmqtt.com/上创建一个帐户 转到右上角的控制面板 点击“创建”按钮安装libsudo pip install paho-mqtt注:不加·sudo可会有如下一些错误Exception:Traceback (most recent call last): File "/usr/lib/python2.7/dist...原创 2018-08-08 23:13:51 · 894 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key)
输入设备(如按键,键盘,触摸屏等)是典型的字符设备,其一般工作原理是底层在按键或触摸等动作发生时产生一个中断,然后CPU通过SPI,I2C总线读取键值。 在这些工作中之后中断和读键值是与设备相关的,而输入事件的缓冲区管理,字符设备驱动的file_operations接口则对输入设备是通用的。因此内核设计了输入子系统,由核心层处理公共的工作。先看gpio-keys platform_drive...原创 2018-07-01 22:13:36 · 2164 阅读 · 0 评论 -
树莓派 -- 按键 (key)使用BCM2835 gpio library
BCM2835 GPIO library介绍 This is a C library for Raspberry Pi (RPi). It provides access to GPIO and other IO functions on the Broadcom BCM 2835 chip, as used in the RaspberryPi, allowing acces...原创 2018-07-01 16:37:00 · 1969 阅读 · 0 评论 -
树莓派--bcm2835 library (2) 交叉编译BCM2835
按照guide, 执行下面的操作InstallationThis library consists of a single non-shared library and header file, which will be installed in the usual places by make install# download the latest version of the librar...原创 2018-06-23 16:07:37 · 2392 阅读 · 1 评论 -
树莓派 -- bcm2835 library (1)
bcm2835 library提供了user space 操作IO的代码。本文不涉及代码分析,先直观的按照user guide完成操作。1. 在Raspberry中安装bcm2835 library2. build LED test3. run led test从http://www.airspayce.com/mikem/bcm2835/ 下载library库,可以直接在树莓派中下载或者宿主机上...原创 2018-06-23 11:00:44 · 4132 阅读 · 0 评论 -
树莓派 - wiringPi
wiringPi其实和BCM2835 library类似,也是通过memmap, IOmap来实现在用户空间直接操作底层寄存器wiringPihttp://wiringpi.com/WiringPi is a PIN based GPIO access library written in C for the BCM2835, BCM2836 and BCM2837 SoC devices use...原创 2018-06-24 12:04:05 · 315 阅读 · 0 评论 -
树莓派 - RPi.GPIO
RPi.GPIO是通过Python/C API实现的,C代码操作底层寄存器, python通过Python/C API调用这些C接口。这是关于RPi.GPIO项目的介绍。 其中提到了有python 垃圾回收机制,并不适合于实时要求的应用。https://pypi.org/project/RPi.GPIO/This package provides a class to control the GP...原创 2018-06-24 12:14:33 · 3424 阅读 · 0 评论 -
树莓派 - 通过sysfs操控GPIO
点亮或熄灭LED硬件上,一个LED灯接在pi的Pin-25. 该引脚为BCM的GPIO26$ gpio readall +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | N...原创 2018-06-24 18:24:51 · 1011 阅读 · 0 评论 -
树莓派2-SSH
树莓派3系统SSH是默认关闭的,将SD卡插入linux,在root 分区,修改/etc/rc.local在exit 0前增加一行/ect/init.d/ssh start将SD卡插回树莓派,上电后,Xshell登录, 用户名 pi, 密码raspberry...原创 2018-06-17 22:27:58 · 146 阅读 · 0 评论 -
树莓派-3 启用root
默认是user: pi, password: raspberry通过如下设置root密码并启用pi@raspberrypi:~ $ sudo passwd rootEnter new UNIX password: Retype new UNIX password: passwd: password updated successfullypi@raspberrypi:~ $ sudo p...原创 2018-06-17 23:24:44 · 4898 阅读 · 1 评论 -
树莓派 - 文件传输
尝试了这几种方式, sftp是成功的。 其他两个有点问题SFTP, nfs, tftp注意: 虚拟机网络设置要配置成bridged模式sftpsftp在树莓派默认是打开的, 在windows host上使用WinSCP. tftp open TFTP Serverhttps://sourceforge.net/projects/tftp-server/?source=typ_redirectnfs...原创 2018-06-18 15:34:45 · 2421 阅读 · 0 评论 -
树莓派 - 驱动hello
树莓派上Linux驱动,从hello world 开始 ... hello.c #include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> MODULE_LICENSE("Dual BSD/GPL"); static int hell...原创 2018-06-18 15:53:52 · 296 阅读 · 0 评论 -
树莓派 - 调试串口
连接USB串口转换器和树莓派GPIO的UART针脚(6、8、10号)配置使能调试串口在树莓派command终端,sudo raspi-config在配置选项中找到重启,在串口打出调试信息...原创 2018-06-18 18:37:02 · 2231 阅读 · 0 评论 -
leds-gpio driver
leds-gpio driver标签(空格分隔): linux raspberry platform-driver我们还是先看看platform device是如何define的platform device 是如何定义的example1在板级驱动中定义, 通过platform_add_devices()函数将这个platform device注册进系统. ar...原创 2018-07-01 00:49:40 · 771 阅读 · 0 评论 -
leds-gpio driver 续1
在上文中分析了gpio-led platform_device是如何定义并注册的。 那么gpio-led platform_device 和 gpio-led platform_driver是如何匹配的呢我们还是先分析probe函数 drivers\leds\leds-gpio.cstatic int gpio_led_probe(struct platform_device *pde...原创 2018-07-01 00:51:15 · 802 阅读 · 1 评论 -
树莓派-1 移植内核
上手树莓派想玩点什么。 BLE5.0? AI? python ? 那么先走起来,一步一步开始 ..., 移植linux内核搭建开发环境vmware + ubuntu 16.04下载源码https://github.com/raspberrypi/linuxgit clone --depth=1 https://github.com/raspberrypi/linux.git下载toolhtt...原创 2018-06-16 23:16:24 · 1045 阅读 · 0 评论