Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeavisionReverse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
c3pb
GeavisionReverse
Compare revisions
40c80986bba2d5114afc98e61f1905866a132f92 to 31386add0af60539be1abcaad55217183a7fc838
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
c3pb/GeavisionReverse
Select target project
No results found
31386add0af60539be1abcaad55217183a7fc838
Select Git revision
Branches
controller-framebuffers
master
Swap
Target
c3pb/GeavisionReverse
Select target project
c3pb/GeavisionReverse
1 result
40c80986bba2d5114afc98e61f1905866a132f92
Select Git revision
Branches
controller-framebuffers
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
add display number config option
· ae266307
Marvin Feiter
authored
1 month ago
ae266307
find and fix that one overflow :/
· b9907524
Marvin Feiter
authored
1 month ago
b9907524
add online status messages
· 31386add
Marvin Feiter
authored
1 month ago
31386add
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
Software/GeaVisionController/main/Kconfig.projbuild
+6
-0
6 additions, 0 deletions
Software/GeaVisionController/main/Kconfig.projbuild
Software/GeaVisionController/main/main.cpp
+17
-8
17 additions, 8 deletions
Software/GeaVisionController/main/main.cpp
with
25 additions
and
9 deletions
.gitignore
View file @
31386add
*.pyc
.venv
\ No newline at end of file
.venv
build
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Software/GeaVisionController/main/Kconfig.projbuild
View file @
31386add
...
...
@@ -23,5 +23,11 @@ menu "GeaVision"
default "mqtt://192.168.2.100"
help
Url form the orbiter mqtt server
config GEA_DISPLAY_CHARACTERS
int "Number of GV33 Display panels"
default 48
help
Number of GV33 Display panels
endmenu
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Software/GeaVisionController/main/main.cpp
View file @
31386add
...
...
@@ -62,24 +62,24 @@ static void log_error_if_nonzero(const char* message, int error_code) {
}
}
char
*
bin2str
(
char
*
data
,
in
t
&
len
)
{
char
*
buffer
=
new
char
[
len
*
3
+
4
];
// two chars plus space per byte
char
*
bin2str
(
char
*
data
,
size_
t
&
len
)
{
char
*
buffer
=
new
char
[
len
*
3
+
5
];
// two chars plus space per byte
std
::
fill
(
buffer
,
buffer
+
(
len
*
3
),
0
);
uint
cursor
=
0
;
std
::
string
dbgmsg
=
""
;
cursor
+=
sprintf
(
buffer
+
cursor
,
"RAW="
);
std
::
for_each
(
data
,
data
+
len
,
[
&
cursor
,
&
buffer
](
char
c
)
{
cursor
+=
sprintf
(
buffer
+
cursor
,
" %
hh
x"
,
c
);
});
std
::
for_each
(
data
,
data
+
len
,
[
&
cursor
,
&
buffer
](
char
c
)
{
cursor
+=
sprintf
(
buffer
+
cursor
,
" %
02
x"
,
c
);
});
return
buffer
;
}
static
void
mqtt_event_handler
(
void
*
handler_args
,
esp_event_base_t
base
,
int32_t
event_id
,
void
*
event_data
)
{
ESP_LOGD
(
TAG
,
"Event dispatched from event loop base=%s, event_id=%"
PRIi32
""
,
base
,
event_id
);
ESP_LOGD
(
MQTT_
TAG
,
"Event dispatched from event loop base=%s, event_id=%"
PRIi32
""
,
base
,
event_id
);
esp_mqtt_event_handle_t
event
=
(
esp_mqtt_event_handle_t
)
event_data
;
esp_mqtt_client_handle_t
client
=
event
->
client
;
// int msg_id;
switch
((
esp_mqtt_event_id_t
)
event_id
)
{
case
MQTT_EVENT_CONNECTED
:
ESP_LOGI
(
TAG
,
"MQTT_EVENT_CONNECTED"
);
ESP_LOGI
(
MQTT_
TAG
,
"MQTT_EVENT_CONNECTED"
);
// msg_id = esp_mqtt_client_publish(client, "/topic/qos1", "data_3", 0, 1, 0);
// ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id);
...
...
@@ -104,6 +104,8 @@ static void mqtt_event_handler(void* handler_args, esp_event_base_t base, int32_
esp_mqtt_client_subscribe
(
client
,
"GeaVision/data/char"
,
0
);
esp_mqtt_client_publish
(
client
,
"GeaVision/status"
,
"online"
,
0
,
0
,
0
);
break
;
case
MQTT_EVENT_DISCONNECTED
:
ESP_LOGI
(
TAG
,
"MQTT_EVENT_DISCONNECTED"
);
...
...
@@ -134,8 +136,8 @@ static void mqtt_event_handler(void* handler_args, esp_event_base_t base, int32_
for
(
uint
i
=
0
;
i
<
lcd_data_len
;
i
++
)
{
lcd_data
->
push_back
((
uint8_t
)
(
event
->
data
[
i
]));
}
ESP_LOGD
(
DISPLAY_TAG
,
"LCD data size: %d"
,
lcd_data
->
size
()
);
ESP_LOGD
(
DISPLAY_TAG
,
"%s"
,
bin2str
(
event
->
data
,
event
->
data_len
));
ESP_LOGD
(
DISPLAY_TAG
,
"LCD data size: %d"
,
lcd_data
_len
);
ESP_LOGD
(
DISPLAY_TAG
,
"%s"
,
bin2str
(
event
->
data
,
lcd_
data_len
));
}
else
if
(
topic
==
"GeaVision/data/char"
)
{
ESP_LOGD
(
DISPLAY_TAG
,
"Received char data: %.*s"
,
1
,
event
->
data
);
}
else
if
(
topic
==
"GeaVision/data/string"
)
{
...
...
@@ -274,6 +276,7 @@ void app_main(void) {
esp_log_level_set
(
"wifi"
,
ESP_LOG_WARN
);
esp_log_level_set
(
"wifi_init"
,
ESP_LOG_WARN
);
esp_log_level_set
(
DISPLAY_TAG
,
ESP_LOG_DEBUG
);
esp_log_level_set
(
TAG
,
ESP_LOG_DEBUG
);
// app_desc = esp_app_get_description();
...
...
@@ -347,6 +350,13 @@ void app_main(void) {
esp_mqtt_client_config_t
mqtt_cfg
=
{};
mqtt_cfg
.
broker
.
address
.
uri
=
mqtt_url
.
c_str
();
mqtt_cfg
.
session
.
last_will
.
topic
=
"GeaVision/status"
;
mqtt_cfg
.
session
.
last_will
.
msg
=
"offline"
;
mqtt_cfg
.
session
.
last_will
.
msg_len
=
7
;
mqtt_cfg
.
session
.
last_will
.
qos
=
1
;
mqtt_cfg
.
session
.
last_will
.
retain
=
true
;
mqtt_cfg
.
session
.
disable_clean_session
=
false
;
mqtt_cfg
.
session
.
keepalive
=
30
;
client
=
esp_mqtt_client_init
(
&
mqtt_cfg
);
esp_mqtt_client_register_event
(
client
,
MQTT_EVENT_ANY
,
mqtt_event_handler
,
client
);
...
...
@@ -359,7 +369,6 @@ void app_main(void) {
lcd_data
->
reserve
(
CONFIG_GEA_DISPLAY_CHARACTERS
*
5
);
while
(
1
)
{
ESP_LOGD
(
DISPLAY_TAG
,
"%d"
,
lcd_data
->
size
());
lcd_write
(
spi
,
lcd_data
->
data
(),
lcd_data
->
size
());
vTaskDelay
(
200
/
portTICK_PERIOD_MS
);
}
...
...
This diff is collapsed.
Click to expand it.