1、改中科大源和能用的PocketChip源
sudo nano /etc/apt/sources.list

deb http://chip.jfpossibilities.com/chip/debian/repo jessie main
deb http://chip.jfpossibilities.com/chip/debian/pocketchip jessie main
deb http://mirrors.ustc.edu.cn/debian jessie main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian jessie main contrib non-free
#deb http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free
#下面四行用于media相关的,比如kodi,但是2021.5.2发现已经不能用了
#deb http://mirrors.ustc.edu.cn/debian-multimedia/ jessie main non-free
#deb-src http://mirrors.ustc.edu.cn/debian-multimedia/ jessie main non-free
#deb http://mirrors.ustc.edu.cn/debian-multimedia/ jessie-backports main
#deb-src http://mirrors.ustc.edu.cn/debian-multimedia/ jessie-backports main
#所以换成官方的
deb https://archive.deb-multimedia.org/ jessie main non-free
deb https://archive.deb-multimedia.org/ jessie-backports main

Ctrl+x
y
保存

sudo nano /etc/apt/preferences

Package: *
Pin: origin opensource.nextthing.co
Pin-Priority: 1050

Package: *
Pin: origin chip.jfpossibilities.com
Pin-Priority: 1050
2、安装apt-transport-https
sudo apt install apt-transport-https
3、安装openssh-server并启动
sudo apt install openssh-server
sudo systemctl start ssh.service
4、修改配置
nano /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
5、设置自启动
sudo systemctl enable ssh

执行sudo apt-get update 时会有如下错误

W: GPG 错误:http://mirrors.ustc.edu.cn jessie InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 5C         808C2B65558117

安装 deb-multimedia-keyring 解决
sudo apt-get install deb-multimedia-keyring
或者
wget https://archive.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
或者点击下载
用FileZilla sftp上传到chip下
sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb

1.Ubuntu系统真机(我用的版本18.04)

2.Ubuntu改国内源

备份源

cp /etc/apt/sources.list /etc/apt/sources.list.bak

改源

sudo nano /etc/apt/sources.list

中科大源

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

更新

sudo apt-get update
sudo apt-get upgrade

3.https://github.com/Thore-Krug/Flash-CHIP
建议把需要的文件FQ下载到隐藏文件夹.dl下,Ctrl+h查看隐藏文件
2019-10-18 16-59-27屏幕截图.png

2019-10-15 17-08-48屏幕截图.png

2019-10-15 17-09-12屏幕截图.png

2019-10-15 17-08-29屏幕截图.png

刷完之后发现触摸屏方向是左右上下相反

1、在终端内输入:sudo nano /etc/X11/xorg.conf 将以下添加到最后

Section "InputClass"
Identifier "calibration"
MatchProduct "1c25000.rtp"
Option "Calibration" "3976 191 3823 333"
Option "SwapAxes" "0"
EndSection

ctrl+X 退出
Y保存
回车确认

顺便添加https支持
sudo apt-get install apt-transport-https
安装屏幕校准器
sudo apt-get install xinput-calibrator
这个软件点击校准后会出现1的6行文字,把数字修改保存一下,重启之后会生效,提高触摸准确度

3、最后重启

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
using Debug = UnityEngine.Debug;

public class ResTest2 : MonoBehaviour
{
    private AssetBundleManifest abm;
    private List<string> absList = new List<string>();
    private List<AssetBundle> abs = new List<AssetBundle>();

    // Use this for initialization
    void Start()
    {
        StartCoroutine(LoadABM(ABMLoaded));
    }

    IEnumerator LoadABM(Action action)
    {
        WWW www = new WWW(Application.streamingAssetsPath + "/windows.t");
        yield return www;
        if (string.IsNullOrEmpty(www.error))
        {
            abm = www.assetBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
        }
        www.Dispose();
        www = null;
        if (action != null)
        {
            action();
        }
    }

    void ABMLoaded()
    {
        Debug.Log("ABM加载完成");
        LoadAllAB();
    }

    #region 测试整体的预加载耗时
    Stopwatch load = new Stopwatch();
    #endregion

    /// <summary>
    /// 没有依赖文件的AB
    /// </summary>
    Dictionary<string, AB> lABs = new Dictionary<string, AB>();
    /// <summary>
    /// 有依赖文件的AB
    /// </summary>
    Dictionary<string, AB> dABs = new Dictionary<string, AB>();

    /// <summary>
    /// 加载所有AB文件
    /// </summary>
    private void LoadAllAB()
    {
        #region 测试整体的预加载耗时
        load.Start();
        #endregion
        string[] abNames = abm.GetAllAssetBundles();
        Debug.LogWarning("AB总数:" + abNames.Length);
        foreach (string abName in abNames)
        {
            string[] dNames = abm.GetAllDependencies(abName);
            if (dNames != null && dNames.Length > 0)
            {
                AB ab = new AB();
                ab.name = abName;
                foreach (string dName in dNames)
                {
                    AB dAB = new AB();
                    dAB.name = dName;
                    ab.dABs.Add(dAB);
                }
                if (!dABs.ContainsKey(abName))
                {
                    dABs.Add(abName, ab);
                }
            }
            else
            {
                AB ab = new AB();
                ab.name = abName;
                if (!lABs.ContainsKey(abName))
                {
                    lABs.Add(abName, ab);
                }
            }
        }
        Debug.LogWarning("无依赖:" + lABs.Count);
        Debug.LogWarning("有依赖:" + dABs.Count); 
        labCount = lABs.Count;
        foreach (AB ab in lABs.Values)
        {
            StartCoroutine(LoadLAB(ab, OnLLoaded));
        }
    }

    private void OnLLoaded()
    { 
        Debug.LogWarning("无依赖的AB加载完毕");
        labCount = dABs.Count;
        foreach (AB ab in dABs.Values)
        {
            StartCoroutine(LoadLAB(ab, OnDLoaded));
        }
    }

    private void OnDLoaded()
    {
        #region 测试预加载整体耗时
        load.Stop();
        Debug.LogWarning("加载耗时:" + load.ElapsedMilliseconds);
        load.Reset();
        #endregion 
        Debug.LogWarning("有依赖的AB加载完毕");

        LoadABI("lobby.ui.lobbyroot", null);
    }

    /// <summary>
    /// 无依赖的ab数
    /// </summary>
    private int labCount = 0;
    /// <summary>
    /// 已加载的无依赖ab数
    /// </summary>
    private int lloadedCount = 0;
    /// <summary>
    /// 加载无依赖的AB
    /// </summary>
    /// <param name="abName"></param>
    /// <param name="action"></param>
    /// <returns></returns>
    private IEnumerator LoadLAB(AB ab, Action action)
    {
        WWW www = new WWW(Application.streamingAssetsPath + "/" + ab.name + ".t");
        yield return www;
        if (string.IsNullOrEmpty(www.error))
        {
            AssetBundle assetBundle = www.assetBundle;
            ab.ab = assetBundle;
            ab.isLoaded = true;
            www.Dispose();
            www = null;
            lloadedCount += 1;
            if (lloadedCount == labCount)
            {
                labCount = 0;
                lloadedCount = 0;
                if (action != null)
                {
                    action();
                }
            }
        }
        else
        {
            Debug.LogWarning("www.error:" + www.error);
        }
    }

    private void LoadABI(string abName, Action action)
    {
        #region 测试整体的预加载耗时
        load.Start();
        #endregion
        AB ab = null;
        dABs.TryGetValue(abName, out ab);
        if (ab != null)
        {
            UnityEngine.Object[] assets = ab.ab.LoadAllAssets();
            GameObject go = Instantiate(assets[0]) as GameObject;
        }
        #region 测试预加载整体耗时
        load.Stop();
        Debug.LogWarning("加载耗时:" + load.ElapsedMilliseconds);
        load.Reset();
        #endregion 
        //WWW www = new WWW(Application.streamingAssetsPath + "/" + abName + ".t");
        //yield return www;
        //if (string.IsNullOrEmpty(www.error))
        //{
        //    AssetBundle ab = www.assetBundle;
        //    abs.Add(ab);
        //    UnityEngine.Object[] assets = ab.LoadAllAssets();
        //    www.Dispose();
        //    www = null;
        //    absList.Add(abName);
        //    GameObject go = Instantiate(assets[0]) as GameObject;
        //    yield return new WaitForEndOfFrame();
        //}
    }

    private void OnApplicationQuit()
    {
        for (int i = 0; i < abs.Count; i++)
        {
            abs[i].Unload(true);
            abs[i] = null;
        }
        abs.Clear();
        absList.Clear();
        Resources.UnloadUnusedAssets();
    }
}

using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// AssetBundle Item
/// </summary>
public class AB
{
    /// <summary>
    /// abname
    /// </summary>
    public string name = "";
    public AssetBundle ab = null;
    /// <summary>
    /// 依赖文件
    /// </summary>
    public List<AB> dABs = new List<AB>();
    /// <summary>
    /// 是否已加载
    /// </summary>
    public bool isLoaded = false;
} 

TIM截图20191011121521.jpg

using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc;

namespace WebApplication1.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UpLoadController : ControllerBase
    {
        private readonly IHostingEnvironment _hostingEnvironment;

        public UpLoadController(IHostingEnvironment hostingEnvironment)
        {
            _hostingEnvironment = hostingEnvironment;
        }

        [HttpPost]
        public string Post([FromForm] IFormCollection formCollection)
        {
            string result = "";
            string webRootPath = _hostingEnvironment.ContentRootPath;
            string contentRootPath = _hostingEnvironment.ContentRootPath;

            FormFileCollection filelist = (FormFileCollection)formCollection.Files;

            foreach (IFormFile file in filelist)
            {
                String Tpath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                string name = file.FileName;
                string FileName = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                string FilePath = webRootPath + Tpath;

                string type = Path.GetExtension(name);
                DirectoryInfo di = new DirectoryInfo(FilePath);

                if (!di.Exists)
                {
                    di.Create();
                }

                using (FileStream fs = System.IO.File.Create(FilePath + FileName + type))
                {
                    // 复制文件
                    file.CopyTo(fs);
                    // 清空缓冲区数据
                    fs.Flush();
                }
                result = "1";
            }
            return result;
        }
    }
}

Unity中调用

    private IEnumerator UpLoadImg(string filePath)
    {   
        byte[] bs = File.ReadAllBytes(filePath); 
        Log.Debug("bs.Length:" + bs.Length.ToString());  
        WWWForm test = new WWWForm();
        test.AddBinaryData("imgbase.jpg", bs, "imgbase.jpg");
        WWW www = new WWW("http://192.168.2.185/api/upload", test);
        yield return www;
        Log.Debug(www.text);
    }

1、Failed building wheel for pyaudio
使用 sudo apt-get install python-pyaudio python3-pyaudio安装
2、TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
安装超时,最简单解决方案:pip --default-timeout=5000 install
3、FileNotFoundError: [Errno 2] No such file or directory: 'fswebcam': 'fswebcam'
安装fswebcam sudo apt-get install fswebcam