Skip to content

Commit 8b41ed3

Browse files
Deprecate ESP (commaai#592)
* remove unused wifi tests * remove that one too * no bootmode from ESP * clean that up * remove two more wifi tests * remove boardesp and esptool * esp_gps -> gps * missed those * remove esptool refs * remove esp certs * no more wifi * that was old * cleanup jenkins dockerfile * fix linter * remove more wifi refs * clone panda jungle from github * no copy * always default esp to off
1 parent 6ae6221 commit 8b41ed3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+76
-5256
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
.git
22
.DS_Store
3-
boardesp/esp-open-sdk

.github/workflows/test.yaml

-20
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,6 @@ jobs:
4545
- name: Build pedal STM bootstub image
4646
run: $RUN "cd /tmp/openpilot/panda/board/pedal && make obj/bootstub.bin"
4747

48-
build_esp:
49-
name: build esp
50-
runs-on: ubuntu-16.04
51-
timeout-minutes: 45
52-
steps:
53-
- uses: actions/checkout@v2
54-
- name: Build docker image
55-
run: |
56-
docker pull $(grep -ioP '(?<=^from)\s+\S+' tests/build/Dockerfile.panda_esp) || true
57-
docker pull docker.io/commaai/panda_esp:latest || true
58-
docker build --cache-from docker.io/commaai/panda_esp:latest -t panda_esp -f tests/build/Dockerfile.panda_esp .
59-
- name: Build ESP image
60-
run: docker run --rm panda_esp /bin/sh -c "cd /panda/boardesp && make user1.bin"
61-
- name: Push image
62-
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/panda'
63-
run: |
64-
docker login -u wmelching -p ${{ secrets.COMMA_DOCKERHUB_TOKEN }}
65-
docker tag panda_esp docker.io/commaai/panda_esp:latest
66-
docker push docker.io/commaai/panda_esp:latest
67-
6848
safety:
6949
name: safety
7050
runs-on: ubuntu-16.04

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
exclude: '^(tests/automated)/'
1919
args:
2020
- --select=F,E112,E113,E304,E501,E502,E701,E702,E703,E71,E72,E731,W191,W6
21-
- --exclude=python/esptool.py,tests/gmbitbang/*
21+
- --exclude=tests/gmbitbang/*
2222
- --max-line-length=160
2323
- --statistics
2424
- repo: local

Dockerfile

+1-12
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-instal
5454

5555
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
5656
RUN pyenv install 3.7.3
57-
RUN pyenv install 2.7.12
5857
RUN pyenv global 3.7.3
5958
RUN pyenv rehash
6059

@@ -68,16 +67,6 @@ ENV HOME /home/batman
6867

6968
ENV PYTHONPATH /tmp:$PYTHONPATH
7069

71-
COPY ./boardesp/get_sdk_ci.sh /tmp/panda/boardesp/
72-
COPY ./boardesp/python2_make.py /tmp/panda/boardesp/
73-
74-
COPY ./panda_jungle /tmp/panda_jungle
75-
76-
RUN useradd --system -s /sbin/nologin pandauser
77-
RUN mkdir -p /tmp/panda/boardesp/esp-open-sdk
78-
RUN chown pandauser /tmp/panda/boardesp/esp-open-sdk
79-
USER pandauser
80-
RUN cd /tmp/panda/boardesp && ./get_sdk_ci.sh
81-
USER root
70+
RUN cd /tmp && git clone https://github.com/commaai/panda_jungle.git
8271

8372
ADD ./panda.tar.gz /tmp/panda

Jenkinsfile

+3-23
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,19 @@ pipeline {
1414
steps {
1515
timeout(time: 60, unit: 'MINUTES') {
1616
script {
17-
try {
18-
sh 'cp -R /home/batman/panda_jungle .'
19-
} catch (err) {
20-
echo "Folder already exists"
21-
}
2217
sh 'git archive -v -o panda.tar.gz --format=tar.gz HEAD'
2318
dockerImage = docker.build("${env.DOCKER_IMAGE_TAG}")
2419
}
2520
}
2621
}
2722
}
28-
stage('Test Dev Build (no WIFI)') {
23+
stage('Test Dev Build') {
2924
steps {
3025
lock(resource: "Pandas", inversePrecedence: true, quantity: 1){
3126
timeout(time: 60, unit: 'MINUTES') {
3227
script {
33-
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'cd /tmp/panda; SKIPWIFI=1 ./run_automated_tests.sh'"
34-
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_dev_nowifi.xml"
28+
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'cd /tmp/panda; ./run_automated_tests.sh'"
29+
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_dev.xml"
3530
sh "docker rm ${env.DOCKER_NAME}"
3631
}
3732
}
@@ -51,21 +46,6 @@ pipeline {
5146
}
5247
}
5348
}
54-
/*
55-
stage('Test Dev Build (WIFI)') {
56-
steps {
57-
lock(resource: "Pandas", inversePrecedence: true, quantity: 1){
58-
timeout(time: 60, unit: 'MINUTES') {
59-
script {
60-
sh "docker run --name ${env.DOCKER_NAME} --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host ${env.DOCKER_IMAGE_TAG} bash -c 'cd /tmp/panda; ./run_automated_tests.sh'"
61-
sh "docker cp ${env.DOCKER_NAME}:/tmp/panda/nosetests.xml test_results_dev.xml"
62-
sh "docker rm ${env.DOCKER_NAME}"
63-
}
64-
}
65-
}
66-
}
67-
}
68-
*/
6949
}
7050
post {
7151
failure {

README.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
<img src="https://github.com/commaai/panda/blob/master/buy.png"></a>
88

9-
It supports 3x CAN, 2x LIN, and 1x GMLAN. It also charges a phone. On the computer side, it has both USB and Wi-Fi.
9+
It supports 3x CAN, 2x LIN, and 1x GMLAN. It also charges a phone. On the computer side, it has USB.
1010

11-
It uses an [STM32F413](http://www.st.com/en/microcontrollers/stm32f413-423.html?querycriteria=productId=LN2004) for low level stuff and an [ESP8266](https://en.wikipedia.org/wiki/ESP8266) for Wi-Fi. They are connected over high speed SPI, so the panda is actually capable of dumping the full contents of the busses over Wi-Fi, unlike every other dongle on amazon. ELM327 is weak, panda is strong.
11+
It uses an [STM32F413](http://www.st.com/en/microcontrollers/stm32f413-423.html?querycriteria=productId=LN2004).
1212

1313
It is 2nd gen hardware, reusing code and parts from the [NEO](https://github.com/commaai/neo) interface board.
1414

@@ -56,30 +56,23 @@ As a universal car interface, it should support every reasonable software interf
5656

5757
- [User space](https://github.com/commaai/panda/tree/master/python)
5858
- [socketcan in kernel](https://github.com/commaai/panda/tree/master/drivers/linux) (alpha)
59-
- [ELM327](https://github.com/commaai/panda/blob/master/boardesp/elm327.c)
6059
- [Windows J2534](https://github.com/commaai/panda/tree/master/drivers/windows)
6160

6261
## Directory structure
6362

6463
- board -- Code that runs on the STM32
65-
- boardesp -- Code that runs on the ESP8266
6664
- drivers -- Drivers (not needed for use with python)
6765
- python   -- Python userspace library for interfacing with the panda
6866
- tests -- Tests and helper programs for panda
6967

70-
## Programming over USB
71-
72-
[Programming the Board (STM32)](board/README.md)
73-
74-
[Programming the ESP](boardesp/README.md)
68+
## Programming
7569

70+
See `board/README.md`
7671

7772
## Debugging
7873

7974
To print out the serial console from the STM32, run `tests/debug_console.py`
8075

81-
To print out the serial console from the ESP8266, run `PORT=1 tests/debug_console.py`
82-
8376
## Safety Model
8477

8578
When a panda powers up, by default it's in `SAFETY_SILENT` mode. While in `SAFETY_SILENT` mode, the buses are also forced to be silent. In order to send messages, you have to select a safety mode. Currently, setting safety modes is only supported over USB. Some of safety modes (for example `SAFETY_ALLOUTPUT`) are disabled in release firmwares. In order to use them, compile and flash your own build.
@@ -100,8 +93,8 @@ These are the [CI regression tests](https://github.com/commaai/panda/actions) we
10093
* A recorded drive for each supported car variant is [replayed through the safety logic](https://github.com/commaai/panda/tree/master/tests/safety_replay)
10194
to ensure that the behavior remains unchanged.
10295
* An internal Hardware-in-the-loop test, which currently only runs on pull requests opened by comma.ai's organization members, verifies the following functionalities:
103-
* compiling the code in various configuration and flashing it both through USB and WiFi.
104-
* Receiving, sending and forwarding CAN messages on all buses, over USB and WiFi.
96+
* compiling the code in various configuration and flashing it both through USB.
97+
* Receiving, sending and forwarding CAN messages on all buses, over USB.
10598

10699
In addition, we run the [pylint](https://www.pylint.org/) and [flake8](https://github.com/PyCQA/flake8) linters on all python files within the panda repo.
107100

TODO

-31
This file was deleted.

__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# flake8: noqa
22
# pylint: skip-file
3-
from .python import Panda, PandaWifiStreaming, PandaDFU, ESPROM, CesantaFlasher, flash_release, BASEDIR, ensure_st_up_to_date, build_st, PandaSerial
3+
from .python import Panda, PandaWifiStreaming, PandaDFU, flash_release, BASEDIR, ensure_st_up_to_date, build_st, PandaSerial

board/board.h

-12
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,10 @@ void detect_board_type(void) {
5454

5555
// ///// Configuration detection ///// //
5656
bool has_external_debug_serial = 0;
57-
bool is_entering_bootmode = 0;
5857

5958
void detect_configuration(void) {
6059
// detect if external serial debugging is present
6160
has_external_debug_serial = detect_with_pull(GPIOA, 3, PULL_DOWN);
62-
63-
#ifdef PANDA
64-
if(hw_type == HW_TYPE_WHITE_PANDA) {
65-
// check if the ESP is trying to put me in boot mode
66-
is_entering_bootmode = !detect_with_pull(GPIOB, 0, PULL_UP);
67-
} else {
68-
is_entering_bootmode = 0;
69-
}
70-
#else
71-
is_entering_bootmode = 0;
72-
#endif
7361
}
7462

7563
// ///// Board functions ///// //

board/board_declarations.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ typedef void (*board_enable_can_transciever)(uint8_t transciever, bool enabled);
44
typedef void (*board_enable_can_transcievers)(bool enabled);
55
typedef void (*board_set_led)(uint8_t color, bool enabled);
66
typedef void (*board_set_usb_power_mode)(uint8_t mode);
7-
typedef void (*board_set_esp_gps_mode)(uint8_t mode);
7+
typedef void (*board_set_gps_mode)(uint8_t mode);
88
typedef void (*board_set_can_mode)(uint8_t mode);
99
typedef void (*board_usb_power_mode_tick)(uint32_t uptime);
1010
typedef bool (*board_check_ignition)(void);
@@ -23,7 +23,7 @@ struct board {
2323
board_enable_can_transcievers enable_can_transcievers;
2424
board_set_led set_led;
2525
board_set_usb_power_mode set_usb_power_mode;
26-
board_set_esp_gps_mode set_esp_gps_mode;
26+
board_set_gps_mode set_gps_mode;
2727
board_set_can_mode set_can_mode;
2828
board_usb_power_mode_tick usb_power_mode_tick;
2929
board_check_ignition check_ignition;
@@ -56,10 +56,10 @@ struct board {
5656
#define USB_POWER_CDP 2U
5757
#define USB_POWER_DCP 3U
5858

59-
// ESP modes
60-
#define ESP_GPS_DISABLED 0U
61-
#define ESP_GPS_ENABLED 1U
62-
#define ESP_GPS_BOOTMODE 2U
59+
// GPS modes
60+
#define GPS_DISABLED 0U
61+
#define GPS_ENABLED 1U
62+
#define GPS_BOOTMODE 2U
6363

6464
// CAN modes
6565
#define CAN_MODE_NORMAL 0U
@@ -76,4 +76,4 @@ bool board_has_gmlan(void);
7676
bool board_has_obd(void);
7777
bool board_has_lin(void);
7878
bool board_has_rtc(void);
79-
bool board_has_relay(void);
79+
bool board_has_relay(void);

board/boards/black.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,24 @@ void black_set_usb_power_mode(uint8_t mode) {
7777
}
7878
}
7979

80-
void black_set_esp_gps_mode(uint8_t mode) {
80+
void black_set_gps_mode(uint8_t mode) {
8181
switch (mode) {
82-
case ESP_GPS_DISABLED:
82+
case GPS_DISABLED:
8383
// GPS OFF
8484
set_gpio_output(GPIOC, 14, 0);
8585
set_gpio_output(GPIOC, 5, 0);
8686
break;
87-
case ESP_GPS_ENABLED:
87+
case GPS_ENABLED:
8888
// GPS ON
8989
set_gpio_output(GPIOC, 14, 1);
9090
set_gpio_output(GPIOC, 5, 1);
9191
break;
92-
case ESP_GPS_BOOTMODE:
92+
case GPS_BOOTMODE:
9393
set_gpio_output(GPIOC, 14, 1);
9494
set_gpio_output(GPIOC, 5, 0);
9595
break;
9696
default:
97-
puts("Invalid ESP/GPS mode\n");
97+
puts("Invalid GPS mode\n");
9898
break;
9999
}
100100
}
@@ -175,7 +175,7 @@ void black_init(void) {
175175
set_gpio_mode(GPIOC, 3, MODE_ANALOG);
176176

177177
// Set default state of GPS
178-
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
178+
current_board->set_gps_mode(GPS_ENABLED);
179179

180180
// C10: OBD_SBU1_RELAY (harness relay driving output)
181181
// C11: OBD_SBU2_RELAY (harness relay driving output)
@@ -240,7 +240,7 @@ const board board_black = {
240240
.enable_can_transcievers = black_enable_can_transcievers,
241241
.set_led = black_set_led,
242242
.set_usb_power_mode = black_set_usb_power_mode,
243-
.set_esp_gps_mode = black_set_esp_gps_mode,
243+
.set_gps_mode = black_set_gps_mode,
244244
.set_can_mode = black_set_can_mode,
245245
.usb_power_mode_tick = black_usb_power_mode_tick,
246246
.check_ignition = black_check_ignition,

board/boards/common.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void common_init_gpio(void){
2323
set_gpio_alternate(GPIOA, 12, GPIO_AF10_OTG_FS);
2424
GPIOA->OSPEEDR = GPIO_OSPEEDER_OSPEEDR11 | GPIO_OSPEEDER_OSPEEDR12;
2525

26-
// A9,A10: USART 1 for talking to the ESP / GPS
26+
// A9,A10: USART 1 for talking to the GPS
2727
set_gpio_alternate(GPIOA, 9, GPIO_AF7_USART1);
2828
set_gpio_alternate(GPIOA, 10, GPIO_AF7_USART1);
2929

@@ -81,4 +81,4 @@ bool detect_with_pull(GPIO_TypeDef *GPIO, int pin, int mode) {
8181
bool ret = get_gpio_input(GPIO, pin);
8282
set_gpio_pullup(GPIO, pin, PULL_NONE);
8383
return ret;
84-
}
84+
}

board/boards/dos.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void dos_set_usb_power_mode(uint8_t mode) {
6565
dos_set_bootkick(mode == USB_POWER_CDP);
6666
}
6767

68-
void dos_set_esp_gps_mode(uint8_t mode) {
68+
void dos_set_gps_mode(uint8_t mode) {
6969
UNUSED(mode);
7070
}
7171

@@ -217,7 +217,7 @@ const board board_dos = {
217217
.enable_can_transcievers = dos_enable_can_transcievers,
218218
.set_led = dos_set_led,
219219
.set_usb_power_mode = dos_set_usb_power_mode,
220-
.set_esp_gps_mode = dos_set_esp_gps_mode,
220+
.set_gps_mode = dos_set_gps_mode,
221221
.set_can_mode = dos_set_can_mode,
222222
.usb_power_mode_tick = dos_usb_power_mode_tick,
223223
.check_ignition = dos_check_ignition,

board/boards/grey.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ void grey_init(void) {
88
white_grey_common_init();
99

1010
// Set default state of GPS
11-
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
11+
current_board->set_gps_mode(GPS_ENABLED);
1212
}
1313

14-
void grey_set_esp_gps_mode(uint8_t mode) {
14+
void grey_set_gps_mode(uint8_t mode) {
1515
switch (mode) {
16-
case ESP_GPS_DISABLED:
16+
case GPS_DISABLED:
1717
// GPS OFF
1818
set_gpio_output(GPIOC, 14, 0);
1919
set_gpio_output(GPIOC, 5, 0);
2020
break;
21-
case ESP_GPS_ENABLED:
21+
case GPS_ENABLED:
2222
// GPS ON
2323
set_gpio_output(GPIOC, 14, 1);
2424
set_gpio_output(GPIOC, 5, 1);
2525
break;
26-
case ESP_GPS_BOOTMODE:
26+
case GPS_BOOTMODE:
2727
set_gpio_output(GPIOC, 14, 1);
2828
set_gpio_output(GPIOC, 5, 0);
2929
break;
@@ -41,7 +41,7 @@ const board board_grey = {
4141
.enable_can_transcievers = white_enable_can_transcievers,
4242
.set_led = white_set_led,
4343
.set_usb_power_mode = white_set_usb_power_mode,
44-
.set_esp_gps_mode = grey_set_esp_gps_mode,
44+
.set_gps_mode = grey_set_gps_mode,
4545
.set_can_mode = white_set_can_mode,
4646
.usb_power_mode_tick = white_usb_power_mode_tick,
4747
.check_ignition = white_check_ignition,

0 commit comments

Comments
 (0)