關於我自己

2020年3月13日 星期五

BeagleBone Black Uboot (am335x_evm_defconfig)





Boot control:
The normal sequence is (S2 button not pushed):
  • MC1 (eMMC on-board flash), MMC0 (SD card), UART0, USB0
S2 button pushed:
  •  SPI0, MMC0 (SD card), USB0, UART0

OS:Ubuntu 18

指令:


sudo apt-get update


sudo apt-get install gcc-arm-linux-gnueabi

sudo apt-get install build-essential

sudo apt-get install bison

sudo apt-get install flex


sudo apt install git

sudo apt install make

git clone git://git.denx.de/u-boot.git u-boot

cd u-boot

alias armmake='make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- '

armmake  distclean

armmake am335x_evm_defconfig

armmake

1.


 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.



2020年3月2日 星期一

Swagger-ui-express

    作業環境:

    express 4.16.0

    swagger-ui-express 3.0.10

    swagger-jsdoc 1.10.3

    指令:
==========================================
express
npm install
npm start
http://127.0.0.1:3000/
==========================================
npm install swagger-ui-express
npm install swagger-jsdoc
http://127.0.0.1:3000/api-docs/


1.執行結果



2.設定JSON格式

 3.編寫區域




GET & POST 部分 (users.js)
=================================

var express = require('express');
var router = express.Router();

/**
 * @swagger
 * /users:
 *   get:
 *     tags:
 *       - users
 *     description: Returns all users
 *     produces:
 *       - application/json
 *     responses:
 *       200:
 *         description: An array of users
 *         content:
 *          application/json:
 *            schema:
 *              type: array
 *              items:
 *                type: object
 *                properties:
 *                  id:
 *                    type: integer
 *                  name:
 *                    type: string 
 */
/* GET users listing. */
router.get('/', function(req, res, next) {
res.setHeader('Content-Type', 'application/json');
    res.end(JSON.stringify({ "id": 1,"name":"user1" }));
   //res.send('respond with a resource');
});

/**
 * @swagger
 * /users:
 *   post:
 *     tags:
 *       - users
 *     description: Creates a new user
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: body
 *         in: body
 *         required: true
 *         schema:
 *           type: object
 *           required:
 *             - username
 *             - password
 *           properties:
 *             username:
 *               type: string
 *             password:
 *               type: password
 *           example: {
 *             "username": "UserName",
 *             "password": "UserPassword"
 *           }
 *     responses:
 *       200:
 *         description: An array of users
 *         content:
 *          application/json:
 *            schema:
 *              type: array
 *              items:
 *                type: object
 *                properties:
 *                  username:
 *                    type: string
 *                  name:
 *                    password: string 
 */
/* GET users listing. */
router.post('/', function(req, res, next) {
res.setHeader('Content-Type', 'application/json');
//req.body.username  req.body.password 
    res.end(JSON.stringify({ "username": req.body.username,"password":req.body.password }));
    //res.send('respond with a resource');
});

module.exports = router;

==================================

參考網址:

https://www.breakyizhan.com/swagger/2991.html

https://swagger.io/specification/


2020年2月26日 星期三

Linux (Socket programming )

<Linux Socket Resful>
作業環境:

開發平台:Ubuntu (BeagleBone)

測試平台:Windows

Eclipse + Gcc


函式: recv , send 

1.主程式:

2.

3.


4.用PUTTY連線到BeagleBone


5.

6.FTP 上傳到 BeagleBone

7.


8.

9.

10.

11.

12.

13.

14.








2019年5月12日 星期日

波 Wave

波 Wave

什麼是構成波的元件?
1. 

1-1:Sin Wave:

1-2:Triangle Wave
1-3:Square Wave:



1-4:Sawtooth Wave :



 2. 雜訊 & 濾波(1D median filter)

2-1: 加入雜訊:

 2-2:小範圍的濾波:

 2-3:大範圍的濾波:

  Other: