gitlab-ce安装笔记

安装:

quick install

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

执行以上命令之后,就可以用apt安装了。

sudo apt install gitlab-ce

安装之后会有提示修改external_url:

alpha@mascot:~/workspace/gitlab$ sudo apt install gitlab-ce 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-104 linux-headers-5.4.0-104-generic linux-image-5.4.0-104-generic linux-modules-5.4.0-104-generic linux-modules-extra-5.4.0-104-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  gitlab-ce
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,247 MB of archives.
After this operation, 3,286 MB of additional disk space will be used.
Get:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal/main amd64 gitlab-ce amd64 15.9.2-ce.0 [1,247 MB]
Fetched 1,247 MB in 1min 37s (12.8 MB/s)                                                                                                                                                     
Selecting previously unselected package gitlab-ce.
(Reading database ... 159036 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_15.9.2-ce.0_amd64.deb ...
Unpacking gitlab-ce (15.9.2-ce.0) ...
Setting up gitlab-ce (15.9.2-ce.0) ...
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=15-9
 

根据提示打开/etc/gitlab/gitlab.rb修改external_url即可:

external_url 'http://0.0.0.0:9981'

修改完成之后执行:

sudo gitlab-ctl reconfigure

这个过程配置了很多东西,花的时间有点长,成功之后会提示重置root密码(这个是GItLab系统的root用户,不是Ubuntu系统的root用户):

......

    - execute /opt/gitlab/bin/gitlab-ctl hup prometheus
[2023-03-04T22:33:43+08:00] INFO: env_dir[/opt/gitlab/etc/alertmanager/env] sending restart action to runit_service[alertmanager] (delayed)
Recipe: monitoring::alertmanager
  * runit_service[alertmanager] action restart (up to date)
[2023-03-04T22:33:44+08:00] INFO: env_dir[/opt/gitlab/etc/postgres-exporter/env] sending restart action to runit_service[postgres-exporter] (delayed)
Recipe: monitoring::postgres-exporter
  * runit_service[postgres-exporter] action restart (up to date)
[2023-03-04T22:33:44+08:00] INFO: Cinc Client Run complete in 193.323360192 seconds

Running handlers:
[2023-03-04T22:33:44+08:00] INFO: Running report handlers
Running handlers complete
[2023-03-04T22:33:44+08:00] INFO: Report handlers complete
Infra Phase complete, 573/1539 resources updated in 03 minutes 15 seconds

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

gitlab Reconfigured!
 

按照提示重置root密码:

alpha@mascot:~/workspace/gitlab$ sudo gitlab-rake "gitlab:password:reset"
Enter username: root
Enter password: 
Confirm password: 
Password successfully updated for user with username root.
 

按照参考文章的介绍,这个时候就可以访问GitLab了。

但我的访问会502出错:

502

Whoops, GitLab is taking too much time to respond.


Try refreshing the page, or going back and attempting the action again.

Please contact your GitLab administrator if this problem persists.

网上的文章说是系统内存太小了。

用sudo gitlab-ctl status命令查看(gitlab-ctl --help可以查看更多命令):

alpha@mascot:~/workspace/gitlab$ sudo gitlab-ctl status
run: alertmanager: (pid 42577) 2107s; run: log: (pid 39330) 3276s
run: gitaly: (pid 42588) 2106s; run: log: (pid 38653) 3395s
run: gitlab-exporter: (pid 42602) 2106s; run: log: (pid 39233) 3294s
run: gitlab-kas: (pid 42604) 2106s; run: log: (pid 38930) 3381s
run: gitlab-workhorse: (pid 42614) 2105s; run: log: (pid 39116) 3314s
run: logrotate: (pid 42623) 2105s; run: log: (pid 38587) 3405s
run: nginx: (pid 42629) 2104s; run: log: (pid 39166) 3308s
run: node-exporter: (pid 42635) 2104s; run: log: (pid 39217) 3300s
run: postgres-exporter: (pid 42641) 2103s; run: log: (pid 39360) 3272s
run: postgresql: (pid 42648) 2103s; run: log: (pid 38793) 3389s
run: prometheus: (pid 42662) 2103s; run: log: (pid 39279) 3282s
run: puma: (pid 45016) 1s; run: log: (pid 39047) 3324s
run: redis: (pid 42676) 2102s; run: log: (pid 38610) 3399s
run: redis-exporter: (pid 42682) 2101s; run: log: (pid 39248) 3290s
run: sidekiq: (pid 42764) 2101s; run: log: (pid 39075) 3320s
 

看起来各个模块都正常启动了。

检查gitlab:

alpha@mascot:~/workspace/gitlab$ sudo gitlab-rake gitlab:check SANITIZE=true --trace
** Invoke gitlab:check (first_time)
** Invoke gitlab_environment (first_time)
** Execute gitlab_environment
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.17.0 ? ... OK (14.17.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Internal API available: FAILED - Internal API unreachable
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Cable config exists? ... yes
Resque config exists? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet)
Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Projects have namespace: ... 
2/1 ... yes
Redis version >= 6.0.0? ... yes
Ruby version >= 2.7.2 ? ... yes (2.7.7)
Git user has default SSH configuration? ... yes
Active users: ... 1
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished
 

实际是8080端口被占用。

修改:sudo vim /etc/gitlab/gitlab.rb

puma['port'] = 8864

修改puma['port'] 为一个不使用的端口,问题解决。

可以用external_url配置的地址访问了,登录root用户,用前面重置root密码时设置的密码登录。

可以注册新的用户,新用户需要root批准才能生效。登录root用户,进入Admin批准用户即可。

在GitHub的用户创建一个Token,就可以从GitHub导入仓库。

GitLab只能从指定的位置导入项目,不能从gitee导入仓库。

参考:

GitLab Installation instructions

GitLab Reset a user’s password

Gitlab 仓库搭建(详细版)_gitlab搭建_~407的博客-优快云博客在ubuntu上部署gitlab详细步骤-优快云博客gitlab访问错误Whoops, GitLab is taking too much time to respond_gblfy的博客-优快云博客GItlab:Internal API available: FAILED - Internal API error 502_gitlab internal_xiaozhidepikaqiu的博客-优快云博客在ubuntu上部署gitlab详细步骤-优快云博客

<think>好的,用户想开发一个基于ESP32、HLK-V20和UWB技术的蓝牙摇杆遥控器。首先,我需要确定每个模块的作用和所需的开发工具。 首先,ESP32作为主控,处理输入和通信。需要安装Arduino IDE或PlatformIO,以及ESP32的开发板支持包。蓝牙功能可能需要额外的库,比如BluetoothSerial或者ESP-IDF的蓝牙栈。用户可能需要使用例程来测试蓝牙连接。 然后是HLK-V20,这个模块是Wi-Fi转串口的,可能用于远程通信。需要确认它的配置方式,通常通过AT指令,所以需要USB转TTL工具和串口调试软件,比如PuTTY或Arduino的串口监视器。用户可能需要编写代码处理HLK-V20的数据传输,比如通过UART与ESP32通信。 接下来是UWB技术,常用的模块是DW1000,基于Decawave的方案。需要安装相应的Arduino库,比如arduino-dw1000。UWB通信需要精确的时间同步,代码部分需要处理距离测量和数据传输。可能需要配置信道、地址等参数,确保模块之间能正确通信。 摇杆部分,可能是模拟摇杆,使用ADC读取X、Y值。ESP32的ADC可能有噪声,需要考虑软件滤波,比如移动平均或卡尔曼滤波。代码中需要设置ADC引脚并读取模拟值,映射到控制范围内。 整个系统的集成需要考虑电源管理,可能需要锂电池和充电模块,比如TP4056。PCB设计工具的话,用户可能需要使用KiCad或Eagle,尤其是如果他们要制作原型板的话。 开发过程中可能需要逻辑分析仪或示波器来调试信号,万用表检查电压和连接。代码版本控制用Git,平台如GitHub。 用户可能还需要考虑多线程处理,因为ESP32有双核,可以使用FreeRTOS任务来处理蓝牙、UWB和摇杆输入同时进行。需要注意资源竞争,使用信号量或队列。 测试时,先分模块调试,比如先确保蓝牙连接正常,再测试UWB测距,最后整合摇杆输入。可能遇到蓝牙和UWB的无线干扰,需要调整频率或屏蔽处理。 文档方面,需要记录每个模块的配置步骤和代码示例,方便后续维护。用户可能需要参考ESP32的官方文档、HLK-V20的数据手册和Decawave的UWB应用笔记。 总之,需要从开发环境搭建开始,逐步集成各个模块,确保硬件连接正确,软件逻辑合理,并进行充分的测试和优化。</think>开发基于ESP32、HLK-V20和UWB技术的蓝牙摇杆遥控器,需要以下开发环境和工具: --- ### 一、硬件需求 1. **核心控制器** - **ESP32开发板**:建议选择集成蓝牙/Wi-Fi的型号(如ESP32-WROOM-32) - **UWB模块**:如Decawave DW1000/DW3000系列或Qorvo DWM3000模组 - **HLK-V20模块**:用于Wi-Fi转串口透传通信 2. **输入设备** - **摇杆模块**:模拟量输出(如双轴电位器式)或数字接口(如I2C) 3. **辅助工具** - USB转TTL串口模块(用于调试HLK-V20) - 万用表/示波器(信号检测) - 杜邦线、面包板或自定义PCB --- ### 二、软件开发环境 #### 1. **ESP32开发** - **IDE选择**: - **Arduino IDE**(快速原型开发) -安装ESP32开发板支持包(通过Board Manager添加) - **PlatformIO**(推荐,支持多平台和库管理) - **ESP-IDF框架**(官方底层开发,适合高级功能) - **关键库**: - `BluetoothSerial.h`(蓝牙通信) - `WiFi.h`(如需Wi-Fi辅助功能) - UWB驱动库(如`arduino-dw1000`) #### 2. **HLK-V20配置** - **AT指令工具**: - 使用串口调试助手(如PuTTY、Arduino Serial Monitor- 配置Wi-Fi参数和透传模式 #### 3. **UWB开发** - **协议实现**: - 基于IEEE 802.15.4-2011标准 - 需要移植或调用厂商提供的SDK(如Decawave的DWAPI) - **关键功能**: - 双向测距(TWR)或到达时间差(TDoA)算法 - 信道配置(频率:3.5-6.5 GHz,带宽:500/900 MHz) --- ### 三、关键工具链 1. **代码管理**: - Git + GitHub/GitLab(版本控制) - VS Code(配合PlatformIO插件) 2. **通信调试**: - **蓝牙调试**:nRF Connect(手机端)、BLE Scanner - **UWB数据监测**:厂商提供的上位机工具(如DecaRange) 3. **硬件调试**: - **逻辑分析仪**(Saleae等) - **电源管理工具**(如可调稳压电源) --- ### 四、开发步骤建议 1. **分模块验证**: - 先独立测试ESP32蓝牙通信和摇杆ADC采样 - 验证HLK-V20的Wi-Fi透传稳定性 - 实现UWB基础测距功能 2. **系统集成**: ```cpp // 示例代码框架(ESP32蓝牙+摇杆) #include <BluetoothSerial.h> BluetoothSerial SerialBT; void setup() { SerialBT.begin("Joystick_Controller"); pinMode(JOYSTICK_X_PIN, INPUT); pinMode(JOYSTICK_Y_PIN, INPUT); } void loop() { int x = analogRead(JOYSTICK_X_PIN); int y = analogRead(JOYSTICK_Y_PIN); SerialBT.printf("X:%d,Y:%d\n", x, y); delay(20); } ``` 3. **功耗优化**: - 使用ESP32的深度睡眠模式 - 优化UWB的占空比(需平衡定位精度与功耗) --- ### 五、注意事项 1. **射频干扰**:蓝牙与UWB共用2.4GHz频段时需错开信道 2. **实时性**:建议采用FreeRTOS任务调度(ESP32支持双核) 3. **认证要求**:商用产品需通过FCC/CE射频认证 建议从官方文档入手: - [ESP32编程指南](https://docs.espressif.com/projects/esp-idf/) - [DW1000开发手册](https://www.decawave.com/support/) - [HLK-V20 AT指令集](https://www.hlktech.com/product_detail/HLK-V20/)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值