树莓派
文章平均质量分 82
feiwatson
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
树莓派搭建NTP server
需要在内网搭建一个NTP server, 大致的示意图如下IT 网络上的设备能够最为NTP Client 和公网的NTP server 同步。同时其作为内网的NTP server 给内网的IoT设备同步。这里用树莓派做个测试。包括3个部分树莓派安装ubuntu core安装NTP snap测试树莓派安装ubuntu core下载镜像https://ubuntu.com/download/raspberry-pi-core安装准备SD卡format copy 镜像原创 2021-12-31 11:24:17 · 3882 阅读 · 0 评论 -
走马观花看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 · 1412 阅读 · 0 评论 -
蓝牙串口实现
我们说蓝牙串口,一般是用于手机App 和嵌入式设备之间通信。有两种实现方式Bluetooth SPPBLE GATTBLE GATT 并没有定义标准的Profile用于串口通信。但是BLE相对嵌入式设备更常见,因此基于GATT的串口通信更常见。https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v7.x.x/doc/7.2.0/s110/html/a00061.html如上链接中是个nordic 的例子例子中定了一个Nordic UART原创 2021-12-05 19:37:49 · 10023 阅读 · 0 评论 -
树莓派 Node Red
Node-RED目标:在树莓派上“零编程”快速搭建一个MQTT client 。简介官网https://nodered.org/简介* 基于浏览器的流编辑Node-RED提供了一个基于浏览器的流编辑器,可以使用调色板中广泛的节点轻松地将流连接到一起。然后,只需单击一次,就可以将流部署到运行时。可以使用文本编辑器在编辑器中创建JavaScript函数。内置库允许您保存有用的函数、模板或流以供重用.* 构建在Node.js之上构建在Node.js上的轻量级“运行”,充分利用了它的事件驱动、非阻原创 2021-11-17 21:59:50 · 2736 阅读 · 0 评论 -
边做边学 之 树莓派系列 - MQTT (1)
边做边学 之 树莓派系列 - MQTT (1)MQTT 简介MQTT的拓扑结构MQTT的应用MQTT的应用标题有点长。 这个系列以树莓派为锚。MQTT是网络的主干。BLE,enocrean 以及其他一些现场总线(fieldbus) 是分支。我们先从MQTT协议入手。树莓派上跑MQTT不管是client还是Broker在网上都已经有不少教程,非常容易,不用一个小时跑起来。但我们自然是不单满足于此。果断往细了学(要不这个系列很快就没货了), 最后学以致用,搭平台验证。MQTT 简介MQTT(Message原创 2021-10-13 21:54:36 · 1416 阅读 · 0 评论 -
树莓派 -- i2c学习 续(1) DeviceTree Overlay实例化rtc
上文中讨论了通过sysfs来实例化i2c设备 (rtc ds3231) https://blog.youkuaiyun.com/feiwatson/article/details/81048616本文继续看看如何通过 DeviceTree Overlays来实例化rtc ds3231write dts首先,写一个dts/dts-v1/;/plugin/;/ { co...原创 2018-07-16 22:17:14 · 2817 阅读 · 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 · 436 阅读 · 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 · 578 阅读 · 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 · 3235 阅读 · 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 · 1664 阅读 · 0 评论 -
树莓派 -- oled 续(1) wiringPi
在上文中,分析了wiringPi 的oled demo是使用devfs来控制spi master和spi slave通讯。 https://blog.youkuaiyun.com/feiwatson/article/details/81149028再详细分析一下demo的OLED SSD1306相关代码。定义一个bufferunsigned char buffer[1024];初始化vo...原创 2018-07-21 21:36:51 · 1273 阅读 · 0 评论 -
树莓派 -- oled 续(2) python
上文中的代码通过wiringPi的API调用devfs API来显示图片。 这里分析的Python代码也通过类似的方法来显示图片。主要用到了两个Library.import spidev import RPi.GPIO as GPIORPi.GPIO在 https://blog.youkuaiyun.com/feiwatson/article/details/80790340 大致分析了...原创 2018-07-22 16:34:41 · 845 阅读 · 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 · 600 阅读 · 0 评论 -
树莓派 - MQTT
安装mosquitto下载源代码包 wget http://mosquitto.org/files/source/mosquitto-1.5.tar.gz 解压 tar zxfv mosquitto-1.5.tar.gz 进入目录 cd mosquitto-1.5 编译 make 安装 sudo make installhandle_connect.c:33:25: f...原创 2018-08-08 22:21:11 · 1400 阅读 · 2 评论 -
树莓派 - 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 · 952 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key)
输入设备(如按键,键盘,触摸屏等)是典型的字符设备,其一般工作原理是底层在按键或触摸等动作发生时产生一个中断,然后CPU通过SPI,I2C总线读取键值。 在这些工作中之后中断和读键值是与设备相关的,而输入事件的缓冲区管理,字符设备驱动的file_operations接口则对输入设备是通用的。因此内核设计了输入子系统,由核心层处理公共的工作。先看gpio-keys platform_drive...原创 2018-07-01 22:13:36 · 2352 阅读 · 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 · 2077 阅读 · 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 · 2585 阅读 · 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 · 4280 阅读 · 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 · 391 阅读 · 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 · 3576 阅读 · 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 · 1257 阅读 · 0 评论 -
树莓派 - platform总线,设备和驱动
以树莓派为例子,分析一下其中LED的 platform device 和 platform driver.查看LED设备,被挂载在/sys/devices/platform下。注意其中的driver指向, driver -> ../../../bus/platform/drivers/leds-gpiopi@raspberrypi:/sys/devices/platform/leds $ t...原创 2018-06-24 23:19:40 · 1429 阅读 · 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 · 210 阅读 · 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 · 4996 阅读 · 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 · 2563 阅读 · 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 · 372 阅读 · 0 评论 -
树莓派 - 调试串口
连接USB串口转换器和树莓派GPIO的UART针脚(6、8、10号)配置使能调试串口在树莓派command终端,sudo raspi-config在配置选项中找到重启,在串口打出调试信息...原创 2018-06-18 18:37:02 · 2478 阅读 · 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 · 849 阅读 · 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 · 902 阅读 · 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 · 1161 阅读 · 0 评论
分享