Telnet Server Library (also includes a commandline parser)

This is a simple library that works as a full telnet server. Allows a programmer to Telnet into their SparkCore and execute custom functions.

The benifit of this is that you don’t have to run a serial connection to the SparkCore to debug print data anymore. Now if your SparkCore is in a difficult to reach place just flash the library on it and debug it with the power of Telnet and custom commands that you write.

Please note that this does not work with the current firmware as the current firmware is way to ram hungry. It will however run on the modified firmware that uses less ram for the TCPClient. (in other words the firmware that has not been pushed to the online IDE yet)

I am using it in my own projects. The example project I have included pretty much allows you to do what the SparkCores intial progam does. It allows controlling all the pins and setting the values of the pins. A good set of code to learn how to use the library.

Let me know if you have any bugs or issues with it. I have to admit I have debugged it and use it with a modified Spark firmware due to ram issues.

Source: https://github.com/fearless40/spark-telnet-server-lib.git

7 Likes

Thanks for posting. Its your’s and other community user’s efforts that are making it easier for me to access and control the spark core using different platorms.

:slight_smile: Awesome !

Awesome, thanks for sharing! :slight_smile:

Thanks,
David

I cannot get it running. On the Web IDE I simply get “cannot compile” without any hint what is wrong.
Compile locally I get several errors about wrong usage of min() and max().

In file included from c:\program files\gnu tools arm embedded\4.8 2014q2\arm-none-eabi\include\c++\4.8.4\vector:60:0,
from …/applications/telnet/CommandLineEngine.h:5,
from …/applications/telnet/telnet-server-lib.h:8,
from …/applications/telnet/application.cpp:2:
c:\program files\gnu tools arm embedded\4.8 2014q2\arm-none-eabi\include\c++\4.8.4\bits\stl_algobase.h:239:56: error: macro “min” passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
c:\program files\gnu tools arm embedded\4.8 2014q2\arm-none-eabi\include\c++\4.8.4\bits\stl_algobase.h:260:56: error: macro “max” passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from …/inc/application.h:29:0,
from …/applications/telnet/application.cpp:1:
c:\program files\gnu tools arm embedded\4.8 2014q2\arm-none-eabi\include\c++\4.8.4\bits\stl_algobase.h:193:5: error: expected unqualified-id before 'const’
min(const _Tp& __a, const _Tp& __b)
^
c:\program files\gnu tools arm embedded\4.8 2014q2\arm-none-eabi\include\c++\4.8.4\bits\stl_algobase.h:193:5: error: expected ‘)’ before ‘const’

I will take a look I haven’t used the spark in a while and they have made a bunch of firmware changes since I wrote the library.