gepd / Deviot

Sublime Text plugin for IoT development based in PlatformIO ecosystem (Arduino IDE)
Apache License 2.0
307 stars 56 forks source link

Dev: list of bugs and Improvements #209

Open tablatronix opened 6 years ago

tablatronix commented 6 years ago

The new commits issues.

Ill just post them here before creating a bunch on new dev issues.

terminal /serial select all during update

Windows The deviot terminal and serial monitor text gets selected all(highlighted) when it is running. It is very odd. as it updates all the text highlights and stays selected.

tablatronix commented 6 years ago

Serial pane

Windows Serial monitor forces new layout pane, kind of annoying, I already use serial in pane, but I don't always want it, it also adds new panes when I already have one open, sometimes I have multiple terminals open also (I change com port and start, so i can debug multiple uarts and devices at once). Interesting feature, might need some polishing or options.

If i already have custom layout, I don't need new panes created, so it conflicts with my layouts and messes stuff up.

Every time I close and restart serial, it creates an additional new pane, also.

Also if I do shortcut for serial monitor , it does not seem to work always, but seems to only work when that pane is focused, this was not the case in the past. INVALID, I was toggling it off ( github markdown needs a strikeout! )

also please fix #171

tablatronix commented 6 years ago

Warnings

Windows Compile linter context errors not working anymore ( I know they were wrong line numbers and annoying but they were very useful, I stated getting used to them ) (FYI aside, arduino precompiler says it adds #linenum directives to source code, wonder if that would help)

gepd commented 6 years ago

Every time I close and restart serial, it creates an additional new pane, also.

What is you O.S? I'm on windows and that is not the behavior I get when I restart it

Also if I do shortcut for serial monitor , it does not seem to work always, but seems to only work when > that pane is focused, this was not the case in the past.

I've not change any code related with the shortcut(s), can you check if there is an error in the console when you run the shortcut?

also please fix #171

it was fixed in dev14

tablatronix commented 6 years ago

Sorry it has nothing to do with shortcuts, the menu does it also, open serial monitor, new pane is created, close serial tab, open serial monitor , new pane is created again ad infinitum

tablatronix commented 6 years ago

I think the shortcut not working was something to do with the focus and text selection constantly changing. I will see if it happens again.

tablatronix commented 6 years ago

ahh with regards to the shortut issue, I did not realize that the shortcut toggled the serial monitor, I was toggling it on and off accidentally, while trying to restart it , It is hard to know when its on or off, could the tab title be changed to reflect it ?

gepd commented 6 years ago

could the tab title be changed to reflect it ?

In dev14 I've introduced a new feature that makes the status bar change the color to green when the serial monitor is connected, and red for 3 seconds when it's disconnected.

However there are some issues I'm solving now related to this new feature (the color keeps green when you close the window)

The updates will come in a few hours

tablatronix commented 6 years ago

Will this continue to work with multiple serial windows running ? ohh status bar, yeah that doesn't really help with multiples at all. Since it can only show one status. I thought maybe tab title [off] or something

tablatronix commented 6 years ago

2018-02-12_13-27-08

not sure if gifs work but this is a gif of several issues

gepd commented 6 years ago

I'll add a modification to show the color in the tab instead of the status bar, that way shouldn't be a problem

tablatronix commented 6 years ago

This is how I use serial alot, sometimes even 4 uarts at a time ( debug uarts etc ) 2018-02-12_13-36-09

I have not tested manually starting them from terminal, i just change com and start for now.

gepd commented 6 years ago

console doesn't work until its created

I'll solved this now, the rest of the issues are already solved. I'll it push it all together

tablatronix commented 6 years ago

Sounds good, let me know if you need anything to be tested, I will follow up also on OSX later

gepd commented 6 years ago

Released dev.15

The deviot terminal and serial monitor text gets selected all(highlighted) when it is running. It is very odd. as it updates all the text highlights and stays selected.

Fixed

Serial monitor forces new layout pane, kind of annoying, I already use serial in pane, but I don't always want it, it also adds new panes when I already have one open, sometimes I have multiple terminals open also (I change com port and start, so i can debug multiple uarts and devices at once). Interesting feature, might need some polishing or options.

If i already have custom layout, I don't need new panes created, so it conflicts with my layouts and messes stuff up.

I've added the menu to edit the deviot preferences, go to Preferences > Package Settings > Deviot > Settings

Changes the option terminal_direction and monitor_direction to self. It will avoid to create a new panel

Compile linter context errors not working anymore ( I know they were wrong line numbers and annoying but they were very useful, I stated getting used to them ) (FYI aside, arduino precompiler says it adds #linenum directives to source code, wonder if that would help)

I hope to bring back this soon

console doesn't work until its created

Fixed too

tablatronix commented 6 years ago

osx first run update, it said could not import color_ something, some color file and deviot didnt start, I restarted and it works. Ill see if i logged it somewhere.

tablatronix commented 6 years ago
reloading settings Packages/User/deviot.sublime-settings
Exception in thread Thread-519:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/libraries/serial.py", line 94, in start
    if is_available(self.port):
  File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/libraries/serial.py", line 182, in is_available
    serial.open()
  File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/libraries/pyserial/serialposix.py", line 271, in open
    self._reconfigure_port(force_update=True)
  File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/libraries/pyserial/serialposix.py", line 373, in _reconfigure_port
    if self._stopbits == serial.STOPBITS_ONE:
NameError: global name 'serial' is not defined
tablatronix commented 6 years ago

top level value must be an array Exception in thread Thread-563: Traceback (most recent call last): File "./python3.3/threading.py", line 901, in _bootstrap_inner File "./python3.3/threading.py", line 858, in run File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/platformio/upload.py", line 40, in start_upload self.check_port_selected() File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/libraries/project_check.py", line 229, in check_port_selected config.read(ini_path) File "/Users/shawn/Library/Application Support/Sublime Text 3/Packages/Deviot (Arduino IDE)/libraries/readconfig/init.py", line 99, in read if(not path.exists(filepath)): File "./python3.3/genericpath.py", line 18, in exists TypeError: can't specify None for path argument

gepd commented 6 years ago

I've pushed a commit to solve the serial problems, checks and let me know if you keep getting that errors.

Upload compiles too, I suspect it's related with the serial issue It's, pyserial is returning a null port that is why the second error

tablatronix commented 6 years ago

here is that upgrade error, osx and windows.

reloading plugin Deviot (Arduino IDE).Deviot
Traceback (most recent call last):
  File "C:\Users\user\Documents\projects\bin\sublimetext\sublime_plugin.py", line 109, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "C:\Users\user\Documents\projects\bin\sublimetext\Data\Packages\Deviot (Arduino IDE)\Deviot.py", line 20, in <module>
    from .libraries.paths import getDeviotUserPath, getPluginName, status_color_folder
ImportError: cannot import name status_color_folder
tablatronix commented 6 years ago
tablatronix commented 6 years ago

Windows

gepd commented 6 years ago

No new panel is created when I change the setting in my machine:

panel_direction

tablatronix commented 6 years ago

When NOT self

tablatronix commented 6 years ago

windows

gepd commented 6 years ago

When NOT self

That is the intention when is not self, I don't understand what do you expect

gepd commented 6 years ago

windows starting serial monitor opens deviot console.

In the gif I opened the serial monitor two times and it's not happening. I tried the shortcut and from menu, I can't replicate that

tablatronix commented 6 years ago

hmm, if i set it to right, it still opens multiple panes over and over, that is what I meant.

tablatronix commented 6 years ago

windows

gepd commented 6 years ago

hmm, if i set it to right, it still opens multiple panes over and over, that is what I meant.

yep, to avoid that you have to change the value to self

gepd commented 6 years ago

clean monitor view does not appear to work, I assume it is meant to empty the buffer completely, or is this constrained to 20k lines like auto ?

it should work regardless of the 20k lines, I'll check that

tablatronix commented 6 years ago

did you see this one too, i slipped it in there above

windows starting serial monitor opens deviot console.

( i added checkboxes to stuff)

gepd commented 6 years ago

I tried to replicate it, but I can't. Look the gif I posted, it doesn't open the deviot console

tablatronix commented 6 years ago

2018-02-13_11-09-59

gepd commented 6 years ago

Is that windows? which version? and ST version?

tablatronix commented 6 years ago

windows, should be latest of both make sure you compile first, or else there is no deviot console still

tablatronix commented 6 years ago

windows

odemcuv2_dev\firmware.elf
Building .pioenvs
odemcuv2_dev\firmware.bin
Looking for upload port...
Use manually specified: COM5
Uploading .pioenvs
odemcuv2_dev\firmware.bin

Also where can I find my .elf file ? nm found them

gepd commented 6 years ago

Released dev.16

gepd commented 6 years ago

Also where can I find my .elf file ?

If you are using the PIO structure it will be located in the .pioenvs folder (same folder of your sketch) If you're not using it, it should be in %temp%\Deviot\your_sketch_name\.pioenvs

tablatronix commented 6 years ago

Thanks I was trying to automate this (ESP exception decoder, not mine) , and maybe add it somehow and grab the environments from pio. It needs, the elf file and the exception ( the serial monitor will do ) FYI There is a $35 bounty if you feel like adding this to platformio itself somehow.

java -jar "%userprofile%\Documents\projects\electronics\EspStackTraceDecoder.jar" "%userprofile%\.platformio\packages\toolchain-xtensa\bin\xtensa-lx106-elf-addr2line" "%userprofile%\AppData\Local\Temp\Deviot\OnDemandConfigPortal\.pioenvs\nodemcuv2_dev\firmware.elf" "%userprofile%\Documents\projects\electronics\exception.txt"
gepd commented 6 years ago

I noticed in my deviot console the filenames are being clipped for the build assets. eg. nodemcuv2_dev

Fixed with: https://github.com/gepd/Deviot/commit/db9396d09142179f37e2e2c1aa093c3c5485a0e3

gepd commented 6 years ago

thanks I was trying to automate this, and maybe add it somehow and grab the environments from pio.

You can use: %temp%\Deviot\OnDemandConfigPortal\.pioenvs\nodemcuv2_dev\firmware.elf

Are you using python?

tablatronix commented 6 years ago

Gonna try so i can use it cross platform and add to ST

gepd commented 6 years ago

It needs to be an standalone plugin?

tablatronix commented 6 years ago

Nope, ST has tools, build tools, and instant plugins, and macros etc.

tablatronix commented 6 years ago
gepd commented 6 years ago

That is because you are using the upload option instead of compile.

Upload needs the serial port so it's closed

monitor_reset

tablatronix commented 6 years ago

Of course Ill make a gif, my serial restarts in the focused pane, the left pane. confirmed only osx, not reproducible on windows

tablatronix commented 6 years ago

Windows console still opens when starting serial monitor.

tablatronix commented 6 years ago

so far very stable, been using it all day. Will try to test advanced stuff like ota etc.

gepd commented 6 years ago

I've pushed a possible fix for the console issue (https://github.com/gepd/Deviot/commit/9b77d5cbab1bcab06ff88f12627639252d010a61)

I'll add two more features before release the next version

  1. Linter context errors
  2. An option to cancel the compile/upload process