Tweaknews OpenVpn

 

8 March 2020 deprecated
Tweaknews switched to another vpn provider, Privado. This provider support vpn connections from other devices then only windows.
In the support section there’s enough information to get your vpn running from Android, Linux, Mac and other devices. This will make the work around as described below deprecated.


TweakNews is a usenet provider that’s not that expensive and in some of there plans you have also the possibility to use vpn.
To use vpn they have a app for Windows, Android and Apple. Not for Linux! Wtf, almost all Nas are running on Linux, routers are running on linux, Raspberry runs on Linux, etc…

I’m not gone explain how to install OpenVpn on your device, there are enough tutorials on the net for the device you have to explain that. This post will only help you with the required OpenVpn files for Tweaknews.

I did some “reverse” engineering with the Windows app and luckily they are using OpenVpn as base for the app.
If you install the windows app all required info can be found in the c:\Program Files (x86)\TweakNews\OpenVPN\ directory.
The openvpn.config and tweaknews.crt file are there, you don’t need more to get OpenVpn working.
To make it easier I have combined those 2 files to TweakNews.ovpn for easy importing the settings in Openvpn, you can download it below.

In this file you find on line 3 the Vpn server where you will connect to, in this case to the server in The Netherlands.
To find out ip addresses for other country’s, run the Tweaknews app ones on a Windows desktop and check the openvpn.config file. Share you country and Ip address in the comment below for other users.

After making connection with the server it will ask for the user name and password. For the  username you must use your TweakNet login name and add @tweaknews to it at the end, for example tw1234567@tweaknews. Password is the same as you always use with your Tweaknews account.

 

 

 

 

 

Esp32 jtag debugger with Sloeber

This is a step by step instruction to setup Sloeber “The Eclipse Arduino Ide” with OpenOcd and a FTDI 2232HL as debugger. With this you can debug your Arduino sketch real time on an Espressif ESP32 in circuit with jtag.

As hardware for the debugger I used 2232HL board from Ali-express , this one was around $14. However every board with a FTDI 2232hl will work.
The 2232HL is a 3.3V device so don’t connect to 5V hardware or else the smoke will escape and the 2232HL will stop working.

You need to connect it like this to your hardware:
AD0 – TCK (Gpio13)
AD1 – TDI (Gpio12)
AD2 – TDO (Gpio15)
AD3 – TMS (Gpio14)
GND – GND
Optional serial port:
CD0 – TXD (Gpio3)
CD1 – RXD (Gpio1)

 

Installing Sloeber “The Eclipse Arduino Ide”

  1. Download Sloeber
  2. Extract the gz to the directory of your choice, in this tutorial we use c:\sloeber
  3. Let’s setup some basic stuff for Sloeber.
  4. Arduino -> Preference -> platform and boards
  5. Check Arduino AVR boards and esp8266 2.4.2 (or newer) both are not really necessary for the esp32, but it’s nice to have some samples and libraries.

 

Installing Esp32 Arduino and Sdk

  1. In Sloeber File -> Import -> Projects from git -> Clone URI and copy the url  https://github.com/espressif/arduino-esp32.git in the URI field.
  2. Press next and uncheck all the branches except master, press next again.
  3. Change the directory to C:\sloeber\arduino-esp32 and press next again.
  4. Choose Import as general project and press next again.
  5. Let’s add it to the ide, Arduino -> Preferences -> Platforms and boards
  6. Press the new button next to the Private hardware path and enter C:\sloeber\arduino-esp32 in the path box.
  7. Press Apply and close
  8. Now we need to download the Esp32 sdk, browse with windows to C:\sloeber\arduino-esp32\tools and click on get.exe
  9. Done

 

Replace the FTDI by Winusb driver

  1. Download Zadig , no need to install just run it.
  2. Click Options -> List All devices
  3. Choose in the dropdownbox USB <-> Serial Convertor (interface 0).Be careful here that you select the correct device.
  4. Choose the WinUSB (V6.1.xxxx.xxxxx) driver and press the Install driver button
    Note: For some reason sometimes (win update?, other usb port) windows will roll back to the original FTDI driver and you have to do this again.

 

Installing OpenOcd

  1. Download OpenOcd for the Esp32 from Github (I have used 0.10.0 20180920 version)
  2. Extract the content to C:\Sloeber\Openocd
  3. Download the cfg file for the debugger and place it in C:\sloeber\openocd-esp32\share\openocd\scripts\interface\ftdi
    Note: this file is for the Ftdi 2232HL based debugger that I have. For other debugger look in the C:\sloeber\openocd-esp32\share\openocd\scripts\interface directory. This cfg file can work with other Ftdi based hardware, but I can’t guaranty nor support that.

  4. Connect your debugger to the Esp32 hardware and let’s see if it works by typing on the command line: C:\sloeber\openocd-esp32\bin\openocd.exe –f c:\sloeber\openocd-esp32\share\openocd\scripts\interface\ftdi\quantum.cfg
  5. If you get something as in the picture above with the “device found …..Tensilica” in it you rock. The hardware and OpenOcd are working

 

Setting up a new sketch

  1. Lets start a new project, Arduino -> new sketch, give the project a name and press next
  2. Platform holder c:/sloeber/arduino-esp32 , fill in the rest with the board etc you have. Port is the comport your board is connected to, not the jtag. Press next
  3. Choose Sample sketch -> example -> 01.basics and check blink. Press finish
  4. We need to set some build options for the debugger, right click on your project map, Arduino -> tab compile options and enter in the append to C and C++ field -ggdb -Og. These compiler options are not needed for a production version.
  5. Let’s compile, press Arduino -> verify
  6. And upload it to your board Arduino -> upload sketch. If you have a led connected to the pin as defined in the sketch is should blink now.

 

Setting up the debugger in Sloeber

  1. Right click in the project explorer window on your project and choose Debug as -> Debug configurations.
  2. Choose GDB openOCD debugging and add a new configuration by clicking on the + at the left upper corner.
  3. On the debugger tab check Start OpenOCD locally
  4. Executable path will be C:\sloeber\openocd-esp32\bin\openocd.exe
  5. GDB port: 3333
  6. Add to Config options -s C:\sloeber\openocd-esp32\share\openocd\scripts -f interface\ftdi\quantum.cfg -f target\esp32.cfg -c “adapter_khz 3000”
  7. Check Start GDB session
  8. Executable name for the GDB client will be C:\sloeber\arduino-esp32\tools\xtensa-esp32-elf\bin\xtensa-esp32-elf-gdb.exe

  9. Select the Startup tab and set these settings
  10. Check Initial reset, Type: init
  11. In the command box enter:
    target remote:3333
    mon reset halt
    x $a1=0
  12. Uncheck Enable ARM semihosting
  13. Check load symbols, use project binary should be already have your project name
  14. Uncheck Load executable, debug in ram, Pre-run, Set program counter at (hex)
  15. Set the checkbox Set breakpoint at and fill in textbox loop
  16. Check Continue

  17. Press the Debug button and there you go

You can also program the ESP32 automatic with the jtag before debugging, add in the command box as described in step 61. below the target remote:3333 line
monitor program_esp32 c:/users/evert/Documents/sloeber-workspace/Testesp32/release/Testesp32.bin 0x10000 verify
Note: It was not possible to use in the command box Eclipse variable like {project_loc}, this would be handy so you don’t have to change every project the hard coded path. These variable like {project_loc} contains backslash “\” and GDB expects forward slash”/”. I did  a lot of Google reading but couldn’t find a solution, if you have one let me know.

 

How to use it?

It’s a bit out of scope of this tutorial how to describe full the debug function in Sloeber. Because Sloeber is based on Eclipse there is enough videos etc available to help you out.
To start a debug session you have to Right click your project -> Debug As -> Debug configuration and press debug. Sloeber will then switch to the debug perspective
As a quick reference have a look at this:

  1. Program code window, program is paused at loop(), this because we set this in step 65.
  2. Thread window, here you can see all the threads that are running on the Esp32.
  3. Control buttons, with these you can start, pause, stop and step in various ways trough your code.
  4. Perspective view, you can switch between code and debug perspective
  5. Various windows to see and influence variable, breakpoints etc. Peripherals is unfortunately not working yet.
  6. Some more windows here, cpu registers and Serial monitor view are the most used.

 

Note: If you copy the settings direct from this page watch out that punctuation marks  like and are not copied correct (they have an other, wrong ascii value) and will give problems or error’s. Just retype them and it should work fine.

Vpn with Nokia N900 and Fritzbox

This is an small tutorial to connect your Nokia N900 phone with you network at home or work with an secure VPN connection. Very handy for printing at home, accessing you nas or where i´m using it alot for, Remote desktop from your N900. As VPN server i wanted to use my Fritzbox because it´s already there to communicate with the rest of the world.
The build in VPN functionality of the Fritzbox was not compatible with the OpenVpn that was used on the N900, so OpenVpn was also needed on the Fritzbox.

To begin with i have used this article. The author used it to connect 2 Fritzbox together.
Using this tutorial requires some basic knowledge of Linux, but if you have the N900 then you´re have else you have an iphone.Smile and Steve Jobs determine what you’re doing with it.
First of all some warnings, you can really mess up your N900 or Fritzbox or even delete the whole Internet. Don´t blame me, i´m just some nerd that´s typing this tutorial for you.

Tested it with Fritzbox 7170 with firmware version 58.04.74, Nokia N900 version 3.2010.02.

  1. First we need to download and install OpenVpn and OpenVpn Applet on the N900. The both can be found in the extra-devel repository.
  2. On the Fritzbox we must enable Telnet, this can be done by dialing on the land-line phone connected to the Fritzbox #96*7*
    You can now make an telnet connection with your favourite program to the Frtizbox. The password is the same as for the web interface of the Fritzbox.
  3. The Fritzbox has not enough internal storage to store the Openvpn program. To overcome this problem we use an usb-stick(or external hdd). Make on your usb-stick the subdirectoy vpn. You van do this in your (windows) pc. Keep in mind that we are working with Linux so everything is case sensitive.
  4. Lets make the necessary script and configuration files, or if you really lazy download them. And place the in the correct maps.
    Debug.cfg (Place in the root of the Usb-stick)
    mkdir /var/usb
    mount /dev/sda1 /var/usb
    /var/usb/startup.sh
    startup.sh (Place in the root of the Usb-stick)
    echo Starting telnetd
    /usr/sbin/telnetd -l /sbin/ar7login
    # wait until the DSL connection is establist
    echo Waiting for internet connection
    while !(ping -c 1 www.google.com); do
    sleep 5
    done
    # tun-Device creating if not available yet
    echo Creating TUN device
    mknod /var/tmp/tun c 10 200
    # start OpenVPN
    echo Starting OpenVPN
    cd /var/usb/vpn
    ./openvpn –config Server.ovpn –daemon

    Server.ovpn (Place in the vpn map on the Usb-stick)
    dev tun0
    dev-node /var/tmp/tun
    ifconfig 10.8.0.1 10.8.0.2
    secret /var/usb/vpn/static.key
    keepalive 10 60
    Client.ovpn (Place in the Mydoc directory or sd-card of your N900)
    remote Your.Domain.name
    dev tun
    ifconfig 10.8.0.2 10.8.0.1
    secret static.key
    keepalive 10 60
    ping-timer-rem
    persist-tun
    persist-key
    #route must be in the same subnet as your network
    route 192.168.1.0 255.255.255.0

  5. Download openvpn for your Fritzbox,  unzip it and place the contens on your usb stick in the vpn directory. Place now the usb-stick in your FritzBox.
  6. Now lets mount the usb-stick ;
    mkdir /var/usb
    mount /dev/sda1 /var/usb
    And copy the debug.cfg to the flash directory so that the debug.cfg will executed during the next reboot;
    cat /var/usb/debug.cfg > /var/flash/debug.cfg
  7. Lets make now the key file needed for the vpn connection;
    cd /var/usb/vpn
    ./openvpn --genkey --secret static.key

    Copy this key also to you N900  in the same directory as you used in step 4.
    You need the key to make an secure connection, but it’s a key so don’t lose it.
  8. We need also forward the vpn udp port 1194 to the Fritzbox himself. Fritz doesn’t allow this using the webinterface, so we must do it by hand using nvi (works the same as vi).
    Now where are gone editing the config file of the Fritzbox becarefull you can mess it really up now!
    cd /var/flash
    nvi ar7.cfg
    Find now the section that’s named  forwardrules = if you have already some ports forwarded you see them here also.
    There are multiply forwardrules, but there’s only one that is named only forwardrules. If you doubt, make an dummy port forwarding in the webinterface and search for that one.
    Now add the following line to the section
    "udp 0.0.0.0:1194 0.0.0.0:1194 0 # OpenVPN",
    Don’t forget the comma at the end and save the file. If it’s the last entry the comma should be an ;
  9. Settings should be finished now, lets reboot the Fritzbox by typing reboot.
    After reboot login again with telnet and check if Openvpn is running by typing ps.
    You should see a process running that called openvpn, for example;
    654 root       1600 S   ./openvpn –config Server.ovpn –daemon
    If not try rebooting again or you (or me) has made an mistake in the previous 8 steps.
  10. Final we need configure the settings on the Nokia N900. That’s very easy to do, tap in the status bar on the Openvpn button and choose manage connections.
    Choose new and then select for the configuration file Client.ovpn that we made in step 4. For key file you take the static.key file that we created in step 7.
    Press import to finish. You can use the test button to test the connection. There’s a lot info on the test screen, but when the connection is successfully the last 2 lines are Peer connection initiated withYourIp and Initialization Completed.
  11. It’s ready to be used now!
    Bear in mind that 90% of all connection problems encountered by OpenVPN users are firewall/port forwarding related.For more info about OpenVpn just click
Vectron Veft-factuur

For the Vecton POS system I have build different modules. This is the “Veft-factuur” module.
It’s a standalone invoice module for the Vectron-pos, it don’t need Vcom to operate. It’s using Veft as communication platform with the ecr’s.
Due the communication with Tcp/ip it’s possible to create global network with 1 invoice server. Therefore it’s possible that the customers visit different locations with 1 account.
Veft-factuur is a direct invoice system, it’s not necessary as in Vcom to read first the sales (of all the tables) data in the backoffice and make then an invoice. You can make with “Veft-factuur” direct a invoice of a table. Very popular for Bowling and party centre’s, you can give the customer the invoice direct at the end of the evening.
Account management is done in “Veft-factuur”. Indentification at the ECR can be done with number, scancode, magnetic & chipcard or with an dropdown menu.

veft1
veft2
veft3
veft4
PlayPause
previous arrow
next arrow
 
veft1
veft2
veft3
veft4
previous arrow
next arrow
Vectron Stock

For the Vecton POS system I have build different modules. This is the stock module called “Medium stock”.
With this module you can manage you plu’s, make orders, print barcode labels, check your stock, sales report and more.
It’s the oldest of the modules and has proven itself with various customers.

medium1
medium2
medium3
medium4
medium5
PlayPause
previous arrow
next arrow
 
medium1
medium2
medium3
medium4
medium5
previous arrow
next arrow