Skip to content

Instantly share code, notes, and snippets.

@sillyfrog
sillyfrog / pip.md
Created November 10, 2018 22:17
pip in Jython

To use pip, you must be running Jython v2.7.1 (downloaded from here: http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7.1/jython-standalone-2.7.1.jar). This is not compatible with Esper, so be sure to remove all of these files before upgrading, ie:

rm -rf ./automation/jsr223/000_components/000_Esper.py ./automation/lib/python/esper

With v2.7.1 installed, we can run the Jython from the openHAB installation to install pip

java -jar /openhab/conf/automation/jython/jython-standalone-2.7.1.jar -m ensurepip
@sillyfrog
sillyfrog / Exception
Created June 24, 2018 05:47
homie-esp8266 exception
Decoding stack results
0x4022c300: tcp_write at core/tcp_out.c line 680
0x4022c2a9: tcp_write at core/tcp_out.c line 628
0x40214379: AsyncClient::add(char const*, unsigned int, unsigned char) at /Users/user/Documents/Arduino/libraries/ESPAsyncTCP/src/ESPAsyncTCP.cpp line 255
0x4023f964: umm_free_heap_size at /Users/user/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/umm_malloc/umm_malloc.c line 1745
0x40207278: xPortGetFreeHeapSize at /Users/user/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/heap.c line 162
0x4021d510: EspClass::getFreeHeap() at /Users/user/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/Esp.cpp line 165
0x4021e490: UpdaterClass::begin(unsigned int, int) at /Users/user/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/Updater.cpp line 118
0x40220940: HomieInternals::Logger::write(unsigned char) at /Users/user/Documents/Arduino/libraries/homie-esp8266/src/Homie/Logger.cpp line 21
$ ./install.py
Searching Python 2.7 libraries...
Found Python library: /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
Found Python headers folder: /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/include/python2.7
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
serving on http://localhost:52054
2018-06-12 22:22:09,836 - DEBUG - No global extra conf, not calling method YcmCorePreload
2018-06-12 22:22:09,926 - INFO - Received ready request
2018-06-12 22:22:09,944 - INFO - Received event notification
2018-06-12 22:22:09,944 - DEBUG - Event name: BufferVisit
2018-06-12 22:22:09,945 - INFO - Starting JediHTTP server
2018-06-12 22:22:09,949 - INFO - Received event notification
2018-06-12 22:22:09,949 - INFO - using port 52058
2018-06-12 22:22:09,949 - DEBUG - Event name: FileReadyToParse
2018-06-12 22:22:09,949 - INFO - Adding buffer identifiers for file: /Users/user/test.py
2018-06-12 22:22:10,046 - INFO - Received filetype completion available request
2018-06-12 22:22:14,329 - DEBUG - received /completions request
2018-06-12 22:22:14,411 - DEBUG - pickle loaded: /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
2018-06-12 22:22:14,508 - DEBUG - pickle loaded: /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ntpath.py
2018-06-12 22:22:14,515 - DEBUG - pickle loaded: /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os2emxpath.py
2018-06-12 22:22:14,533 - DEBUG - pickle loaded: /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py
2018-06-12 22:22:14,541 - DEBUG - pickle loaded: /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py
2018-06-12 22:22:14,597 - DEBUG - pickle loaded: /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
2018-06-12 22:22:14,607 - DEBUG - pickle loaded: /usr/local/Ce
2018-06-12 22:22:09,819 - ERROR - Unable to connect to server
Traceback (most recent call last):
File "/Users/user/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connection.py", line 137, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/Users/user/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py", line 91, in create_connection
raise err
File "/Users/user/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py", line 81, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
serving on http://localhost:51980
2018-06-12 22:02:21,634 - ERROR - Unable to connect to server
Traceback (most recent call last):
File "/Users/user/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connection.py", line 137, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/Users/user/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py", line 91, in create_connection
raise err
File "/Users/user/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py", line 81, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/hh/s454r7v56p56v82658r42l8m0000gn/T/ycm_0evqhrp3.log
-- Server Python interpreter: /usr/local/opt/python@2/bin/python2.7
-- Server Python version: 2.7.15
-- Server has Clang support compiled in: True
-- Clang version: clang version 6.0.0 (tags/RELEASE_600/final)
-- No extra configuration file found
-- Python completer debug information:
-- JediHTTP running at: http://127.0.0.1:52058
-- JediHTTP process ID: 9030