Giter VIP home page Giter VIP logo

gdsercommplugin's Introduction

SerCommPlugin

A Godot 4.1+ plugin to read/write Arduino serial input.
Read GDExtension for more

Dependencies

Build system

Compilation Database and/or CMake

Experimental feature
The Scons build will generate a Compilation Database (CD). CLion can open a CD directly
You can also run the generate_cmake.py script to generate a CMakeLists.txt.

mkdir build
cd build
cmake .. 
make

Repo structure

src - Plugin source code
deps - Dependencies, like libserialport. Will be created on install\
godot-cpp - Godot bindings. Will be created on install\

Full Build

This will build everything form scratch

python -m venv ./pvenv

// Activate pvenv for Windows
pvenv\Scripts\activate
// Activate pvenv for Unix/MacOS
source pvenv/bin/activate

pip install -r requirements.txt
python install.py

Quick Build

This will only build the GDSercomm part. Requires at least on Full Build before working

python -m venv ./pvenv

// Activate pvenv for Windows
pvenv\Scripts\activate
// Activate pvenv for Unix/MacOS
source pvenv/bin/activate

pip install -r requirements.txt
python build.py

Output

After a completed build all files you need will be in ./demo/bin directory. Except the libserialport library. It will be inside the ./deps/libserialport directory.

Windows = .\deps\libserialport\x64\Debug\libserialport.dll
Linux = libserialport.so

Usage

  1. Create a SerComm node in your scene.
  2. Select baudrate and port number.
  3. Create a script on any other node in scene
  4. script your logic Screenshot of basic setup

By toggle the radio button the extension will search for available ports and refresh the port dropdown list.

Create a SerComm node for each port you want to read or write to.

gdsercommplugin's People

Contributors

nangidev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gdsercommplugin's Issues

No nativescript_init inside Windows 64bit sercomm.dll file

Following the instructions on how to build the binaries for Windows 64bit will result in an No nativescript_init in sercomm.dll file.

Could this be due to Visual Studio 16 2019 C compiler has changed and need some more options set?

Mac OS

Is there a way to have this plugin working with Max OS ?

how do i use the serial input?

hello! i am kind of new with godot and this is not an issue really but a question. From the plugin window i can see that the data is arriving but i can't understand how i can access the data from my code to use it.

Have a version released to Godot Marketplace

As a user of GDSercommPlugin I want to be able to download the plugin from Godot Marketplace when integrating it in my game.

What do we need to address before this is possible?

  • How do you deploy a plugin in Marketplace?
  • Automated CD/CI of the binaries for all plattforms:
    • Mac OSX
    • Windows
    • Linux
    • Android?
    • IOS?
  • Automated CD/CI for deploying working builds to marketplace

RichTextLabel can not add a integer to text.

For some reason

res://addons/GDSerCommDock/MenuLogic.gd:45 - Invalid type in function 'add_text' in base 'RichTextLabel'. Cannot convert argument 1 from int to String.

when reading from serial.

My input look something like "0.86,0.83"

Can't open dynamic library: C:/Users/Mark/Documents/GDSerCommPlugin-master/addons/GDSerCommDock/bin/GDSercomm.dll, error: Error 126: The specified module could not be found.

On Windows 10, I get the following., from a fresh download of the code from GitHub.

Godot Engine v3.2.2.stable.official (c) 2007-2020 Juan Linietsky, Ariel Manzur & Godot Contributors.
--- GDScript language server started ---
Can't open dynamic library: C:/Users/Mark/Documents/GDSerCommPlugin-master/addons/GDSerCommDock/bin/GDSercomm.dll, error: Error 126: The specified module could not be found.

.
modules/gdnative/gdnative.cpp:483 - No valid library handle, can't get symbol from GDNative object
modules/gdnative/nativescript/nativescript.cpp:1506 - No nativescript_init in "res://addons/GDSerCommDock/bin/GDSercomm.dll" found
Switch Scene Tab
res://addons/GDSerCommDock/MenuLogic.gd:5 - Attempt to call function 'new' in base 'NativeScript' on a null instance.

Build Linux binaries

The steps in the instructions does not build the binaries properly

Building steps

git clone --depth=1 [email protected]:Superwaitsum/GDSercomm.git
cd GDSercomm/
git clone --depth=1 [email protected]:GodotNativeTools/godot_headers.git
git clone --depth=1 [email protected]:ingeniamc/sercomm.git
cd sercomm/
cmake -H. -Bbuild
cmake --build build
cd ..
cp sercomm/build/config.h sercomm/include/public/sercomm/
mkdir lib
cp sercomm/build/libsercomm.so lib/
scons p=platform
cp lib/libsercomm.so bin/
cp bin/libsercomm.so /usr/lib
ldconfig

lddtree output

dev@dev-vm:~/Documents/GDSerCommPlugin/addons/GDSerCommDock/bin$ lddtree libGDSercomm.so 
libGDSercomm.so => ./libGDSercomm.so (interpreter => none)
    libsercomm.so => /usr/lib/libsercomm.so
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
        ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6

Log from Godot

dev@dev-vm:~/Downloads$ ./Godot_v3.2.1-stable_x11.64 
Godot Engine v3.2.1.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: llvmpipe (LLVM 9.0, 128 bits)
 
Running project: /home/dev/Documents/GDSerCommPlugin (::home::dev::Documents::GDSerCommPlugin)
Godot Engine v3.2.1.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: llvmpipe (LLVM 9.0, 128 bits)
 
ERROR: open_dynamic_library: Can't open dynamic library: /home/dev/Documents/GDSerCommPlugin/addons/GDSerCommDock/bin/libGDSercomm.so. Error: /usr/lib/libsercomm.so: undefined symbol: udev_new
   At: drivers/unix/os_unix.cpp:424.
ERROR: get_symbol: No valid library handle, can't get symbol from GDNative object
   At: modules/gdnative/gdnative.cpp:483.
ERROR: init_library: No nativescript_init in "res://addons/GDSerCommDock/bin/libGDSercomm.so" found
   At: modules/gdnative/nativescript/nativescript.cpp:1506.
SCRIPT ERROR: _ready: Attempt to call function 'new' in base 'NativeScript' on a null instance.
   At: res://addons/GDSerCommDock/MenuLogic.gd:5.

Mistake in "Full Build" and "Build system" instructions

Hello,

I think I found 2 small mistakes in your readme file:

  1. In section "Build system" you specify the minimum Python version 3.8. But in build.py you are using Python 3.10 language features, such as the match statement - see here
  2. In section Full Build I think you forgot to describe the activation of the environment pvenv. So if one just copies your instructions the required packages are maybe installed to the global environment.

There is no way to indicate flow control

There are devices, such as the Arduino 33 BLE Sense, whose serial communication requires hardware-level flow control. Currently I can not find how to accomplish this within the plugin (nor am I sure that gdsercomm or sercomm support it after a quick glance at the repos).

Implementing the ability to choose between RTS/CTS would be enough for my immediate purposes personally, but I figure support would also include DTR/DSR as well as XON/XOFF software-based flow control.

Cross compile

I would be nice to have a way to cross compile everything on one computer.
Docker could be a solution.

When plugin active "Nonexistent function 'get_available'" error occures

It seems that the function get_available in MenuLogic.gd isn't found when run as a tool.

I builds the binaries with the instructions in the README.md

I have tried scons p=platform and scons p=windows

OS: Windows 10

if PORT != null && PORT.get_available()>0:

res://addons/GDSerCommDock/MenuLogic.gd:41 - Invalid call. Nonexistent function 'get_available' in base 'Reference (GDSerComm.gdns)'.

Build on Ubuntu 21.20

I tried to build Linux binary. The library built successfully

Distro: Pop OS (based Ubuntu 21.20)
Godot 3.4.1.stable

but got this error when running the project

E 0:00:00.540 init_library: No nativescript_init in "res://addons/GDSerCommDock/bin/libGDSercomm.so" found
<C++ Source> modules/gdnative/nativescript/nativescript.cpp:1510 @ init_library()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.