XMEN BLOGGER

Thursday, December 21, 2017

Raspberry Pi - Ubuntu Mate - create-wireless-access-point-hostapd


From:
https://seravo.fi/2014/create-wireless-access-point-hostapd
https://help.ubuntu.com/community/WifiDocs/WirelessAccessPoint
https://help.ubuntu.com/community/WifiDocs/WiFiHowTo
https://askubuntu.com/questions/180733/how-to-setup-an-access-point-mode-wi-fi-hotspot

dashohoxha/install_wifi_access_point.sh
https://gist.github.com/dashohoxha/5767262
http://dashohoxha.blogspot.com.es/2013/06/how-to-setup-wifi-access-point-on-ubuntu.html

dnsmasq bug
https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1464990

[GUIDE] Making infrastructure wifi hotspot on ubuntu 12.04/12.10 by ogyct
https://forum.xda-developers.com/showthread.php?t=2009381

https://unix.stackexchange.com/questions/119209/hostapd-will-not-start-via-service-but-will-start-directly
https://unix.stackexchange.com/questions/350333/starting-hostapd-fails-acs-unable-to-collect-survey-data
Ubuntu Forums
https://ubuntuforums.org/showthread.php?t=1488953

https://mail.gnome.org/archives/networkmanager-list/2017-April/msg00003.html
https://askubuntu.com/questions/19320/how-to-enable-or-disable-services
https://dajul.com/2011/01/06/solucion-al-error-insserv-warning-script-x-missing-lsb-tags-and-overrides/
https://askubuntu.com/questions/218/command-to-list-services-that-start-on-startup

rsyslog
https://www.raspberrypi.org/forums/viewtopic.php?t=122601
https://github.com/rsyslog/rsyslog/issues/35

https://ubuntu-mate.community/t/something-is-renaming-my-eth0-and-wlan0-interfaces/2884/7
https://askubuntu.com/questions/775597/how-to-use-onboard-wifi-on-raspberry-pi-3-with-ubuntu-server-16-04
https://askubuntu.com/questions/766131/set-static-ip-ubuntu-16-04
https://ubuntuforums.org/archive/index.php/t-1970451.html

Turn your Raspberry Pi into a wireless access point with Hostapd

Linux hotspotDo you want to make a computer function as a WLAN base station, so that other computers can use as it as their wifi access point? This can easily be done using the open source software Hostapd and compatible wifi hardware.

This is a useful thing to do if computer acting as a firewall or as a server in the local network, and you want to avoid adding new appliances that all require their own space and cables in you already crowded server closet. Hostapd enables you to have full control of your WLAN access point and also enhances security. By using Hostapd the system will be completely in your control, every line of code can be audited and the source of all software can be verified and all software can be updated easily. It is quite common that active network devices like wifi access points are initially fairly secure small appliances with Linux inside, but over time their vendors don’t provide timely security updates and local administrators don’t care to install them via some clumsy firmware upgrade mechanism. With a proper Linux server admins can easily SSH into it and run upgrades using the familiar and trusted upgrade channels that Linux server distributions provide.

The first step in creating wireless base station with Hostapd is to make sure the WLAN hardware supports running in access point mode. Examples are listed in the hostapd documentation. A good place to shop for WLAN cards with excellent Linux drivers is thinkpenguin.com and in their product descriptions the WLAN card supported operation modes are nicely listed.

The next step is to install the software called Hostapd by Jouni Malinen and others. This is a very widely used software and it most likely is available in your Linux distribution by default. Many of the WLAN router appliances available actually are small Linux computers running hostapd inside, so by running hostapd on a proper Linux computer will give you at least all the features available in the WIFI routers, including advanced authentication and logging.

Our example commands are for Ubuntu 14.04. You need to have access to install hostapd and dnsmasq Dnsmasq is a small DNS/DHCP server which we’ll use in this setup. To start simply run:

sudo apt-get install hostapd dnsmasq

After that you need to create and edit the configuration file:

zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz | sudo tee -a /etc/hostapd/hostapd.conf
The configuration file /etc/hostapd/hostapd.conf is filled with configuration examples and documentation in comments. The relevant parts for a simple WPA2 protected 802.11g network with the SSID ‘Example-WLAN‘ and password ‘PASS‘ are:

interface=wlan0
ssid=Example-WLAN
hw_mode=g
wpa=2
wpa_passphrase=PASS
wpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256

Next you need to edit the network interfaces configuration to force the WLAN card to only run in the access point mode. Assuming that the access point network will use the address space 192.168.8.* the file /etc/network/interfaces should look something like this:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
hostapd /etc/hostapd/hostapd.conf
address 192.168.8.1
netmask 255.255.255.0
Then we need to have a DNS relay and DHCP server on our wlan0 interface so the clients actually get a working Internet connection, and this can be accomplished by configuring dnsmasq. Like hostapd it also has a very verbose configuration file /etc/dnsmasq.conf, but the relevant parts look like this:

interface=lo,wlan0
no-dhcp-interface=lo
dhcp-range=192.168.8.20,192.168.8.254,255.255.255.0,12h

Next we need to make sure that the Linux kernel forwards traffic from our wireless network onto other destination networks. For that you need to edit the file /etc/sysctl.conf and make sure it has lines like this:

net.ipv4.ip_forward=1

We need to activate NAT in the built-in firewall of Linux to make sure the traffic going out uses the external address as its source address and thus can be routed back. It can be done for example by appending the following line to the file /etc/rc.local:

iptables -t nat -A POSTROUTING -s 192.168.8.0/24 ! -d 192.168.8.0/24 -j MASQUERADE

Some WLAN card hardware might have a virtual on/off switch. If you have such hardware you might need to also run rfkill to enable the hardware using a command like rfkill unblock 0.

The same computer also runs Network Manager (as for example Ubuntu does by default) you need to edit it’s settings so that if won’t interfere with the new wifi access point. Make sure file /etc/NetworkManager/NetworkManager.conf looks like this:

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false
Now all configuration should be done. To be sure all changes take effect, finish by rebooting the computer.

If everything is working, a new WLAN network should be detected by other devices.
On the WLAN-server you’ll see similar output from these commands:

$ iw wlan0 info
Interface wlan0
ifindex 3
type AP
wiphy 0

$ iwconfig
wlan0 IEEE 802.11bgn Mode:Master Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off

$ ifconfig
wlan0 Link encap:Ethernet HWaddr f4:ec:38:de:c8:d2
inet addr:192.168.8.1 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::f6ec:38ff:fede:c8d2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5463040 errors:0 dropped:0 overruns:0 frame:0
TX packets:8166528 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:861148382 (861.1 MB) TX bytes:9489973056 (9.4 GB)

Monday, October 09, 2017

Raspberry Pi 1, 2 or 3 and Zero W - microSD Card Speed


From: Raspberrypi.org Forum
https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=144493
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=188592


Recommended: Sandisk Ultra!!! 32Gb, 64Gb or 128Gb


-Test with a benchmark software (sdbench):

sudo nano sdbench.sh
sudo chmod +x sdbench.sh
sudo ./sdbench.sh


-To fully utilize the speeds for the card, you have to enable sd_overclock in /boot/config.txt:

dtparam=sd_overclock=100

NOTE: It has to be HC-1/UHS-1 or higher (like U1 or higher, or HC-I or higher).


-Run sdbench.sh:
32GB EVO+ Samsung UHS-1/HC-1 micro sdcard in a RPI3

pi@raspberrypi:~ $ sudo ./sdbench.sh

CONFIG:
CLOCK : 100.000 MHz
CORE : 500 MHz, turbo=1
DATA : 512 MB, /root/test.dat

HDPARM:
======
Timing O_DIRECT disk reads: 128 MB in 3.02 seconds = 42.41 MB/sec
Timing O_DIRECT disk reads: 128 MB in 3.05 seconds = 42.03 MB/sec
Timing O_DIRECT disk reads: 122 MB in 3.01 seconds = 40.50 MB/sec

WRITE:
=====
536870912 bytes (537 MB) copied, 27.4302 s, 19.6 MB/s
536870912 bytes (537 MB) copied, 27.386 s, 19.6 MB/s
536870912 bytes (537 MB) copied, 25.623 s, 21.0 MB/s

READ:
====
536870912 bytes (537 MB) copied, 12.312 s, 43.6 MB/s
536870912 bytes (537 MB) copied, 12.3474 s, 43.5 MB/s
536870912 bytes (537 MB) copied, 12.3233 s, 43.6 MB/s

RESULT (AVG):
============
Overlay config core_freq turbo overclock_50 WRITE READ HDPARM
500 1 100.000 MHz 19.12 MB/s 41.54 MB/s 41.63 MB/s


-Turbo mode:

sudo echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
sudo echo 20 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

Thursday, April 13, 2017

Asteroid 2014 JO25 - 18th April 2017

More info at:
https://www.jpl.nasa.gov/news/news.php?feature=6807

And Espacio Profundo Forum:
http://www.espacioprofundo.com.ar/topic/27770-asteroide-2014-jo25/

And:
http://www.sociedadastronomia.com/Asteroide2014JO25.html

¿Cómo localizar el Asteroide 2014 JO25?

Mirando hacia el ESTE, entre las 9:00 p.m. y 10:00 p.m. del 19 de Abril, 2017.

Tuesday, April 04, 2017

Canciones para aprender ingles - links!!!


Letras en Ingles

10 canciones que te ayudaran a aprender ingles de forma efectiva y rapida

01 ‘Blank Space’ de Taylor Swift
02 ‘If I Were a Boy’ de Beyoncé
03 ‘ The Heart Wants What It Wants’ de Selena Gomez
04 ‘Thinking Out Loud’ de Ed Sheeran
05 ‘Torn’ de Natalie Imbruglia
06 ‘ Somebody That I Used to Know’ de Gotye
07 ‘Every Breath You Take’ de Police
08 ‘Someone Like You’ de Adele
09 ‘Friday I’m in Love’ de The Cure
10 ‘Time After Time’ de Cindy Lauper

Once upon a time, Freddie said: di-ro-reeeeeee-ro!!! ;-P


EEEEEEEROOOOO

EEEEEEEROOOOO

ERO

DIRORERE RERERE ERO

DIRORERE RERERE ERO

ERO

DIRORERE RERERERO

ERO

ERO

EEEEEEEEEEERO

DIROREREEEEERO

DIRORERERO DIROREROOO DIDOREREREREEEEEERO

DIROREEEEEERO DIROREEEEEEEEEEEERO DIROREEEEEEEEEEEEEERO

DIROREREEEEEERO ERO ERO ERO

DIROREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEERO!!!!!!!!


And Live at Wembley 11.7.1986 - A Kind Of Magic

Thursday, March 23, 2017

18650 Batteries


From: Battery Types, http://www.best18650battery.com/



-For Li-ion batteries

18 - The first two digits "18" stand for the battery diameter in millimeters. In this case width of the battery is 18mm (millimeters).
65 - The third, and fourth digit stand for length in millimeters. That would be 65mm.
0 - For simplicity just forget about the last digit zero for now.

-So what is a 16340 battery ?

16mm - diameter
34mm – length

Besides size and capacity, you may notice the 3 letter codes on most Li batteries like ICR, IMR, INR, NCR, etc. printed on the battery like the Samsung ICR18650-26F, INR18650-30Q, Panasonic NCR18650B, etc. These are various types of Li-ion batteries . The 3 letter codes are manufacturer codes, and most but not all, use this as a standard way to refer to the different types of cells.

“I_R”

The first Letter "I" just means that the cell is a Li-ion rechargeable.
Second letter refers to the cathode material.
The last letter "R" just means the cell is round.

ICR = Li-ion Rechargeable, the "C" = Cobalt.
IMR = the "M" stands for Manganese, or "Mn".
INR = the “N” stands for Nickel.
IFR = the "F" stands for the element "Fe" which is Iron.

INR seems to have rather similar proterties to IMR i.e. low internal resistance and delivery high current without causing the battery from getting too hot. It is also classified as a safer chemistry so it's another ideal high drain battery.

-What about Panasonic NCR18650B ?

The name NCR18650B is just Panasonic’s part number and it’s also a Lithium Cobalt battery, like an ICR cell. Panasonic does put some additional safety features that make it safest of any ICR cell.

The NCR18650B is available with and without protection. Again for protected cell, it may be offered as a rewrapped under different brand or same brand but the dimension will be longer and wider, so it may not suit some devices.

Capacity or mAh (milliampere hour) Rating - an approximation for how long a battery charge should last on a full charge. This is the battery capacity and is used to describe a battery's "fuel tank", as in general a battery with higher mAh ratings will last longer assuming that it's subjected to same usage patterns.

To estimate how long a battery last, divide the capacity of battery by the current consumed by device. For example, the battery is 3400mAh and a cree torch consumed 2.4A (2400mA), it will last 1.42 hours approx. If you use a 2600mAh, it last you only 1.08 hours only.

The "best battery" is not always the one with the largest mAh rating. In most applications a higher current rating (C-rating) determines the better battery.

The C rating is the maximum safe continuous discharge rate of a battery. If you see 10C on your battery, it means it can be discharged at 10 times that cell’s capacity. Capacity refers to the milliamp-hour rating of the battery, which will be listed as a number followed by mAh (2000mAh, for example). Here's the easy way to find your battery's discharge rate; just multiply the number from the C rating by the cell's capacity. Keep in mind that 1000 milliamps equals one amp.
Here's an example, using an 3.7V 2000mAh 10C

3.7 volt 2000mAh -10C
2000 milliamps = 2 amps
2 Amps x 10 = 20 amps continuous discharge

This means that you can safely draw up to 20 amps continuously from that 3.7V 2000mAh 10C without doing damage to your battery.

-Example: Samsung ICR18650 26-F 2600mAh 2C

It means the max. continuous discharge current is 5.2A (2.6x2). Now you know why this battery price is so low, because of low C-ratings and also not really a high capacity (mAh) battery.

Tuesday, March 21, 2017

Nagios - Windows passive PING


-Configure nsclient (NSC.ini):

[modules]
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
; You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; * *
; * N O T I C E ! ! ! - Y O U H A V E T O E D I T T H I S *
; * *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
NSClientListener.dll
NRPEListener.dll

[Settings]
allowed_hosts=10.68.55.160
use_file=1

[NRPE]
port=5666
command_timeout=90

[NRPE Handlers]
passive_ping=c:\nsclient\pping.bat

-Create batch file (pping.bat):

@echo off
ping –n 1 178.60.210.204 -w 20000 >NUL
IF ERRORLEVEL 1 GOTO err
IF ERRORLEVEL 0 GOTO ok
GOTO unknown

:err
echo CRITICAL: Ping check failed
exit /B 2

:unknown
echo UNKNOWN: Something went wrong
exit /B 3

:ok
echo OK: Ping succeded
exit /B 0

Sunday, March 12, 2017

GoPro - DIY HandHeld Gimbal

3-Axis gimbal w/ Strom32 controller - HAKRC Strom32 BGC board

OPTION 1: RENOWATIO R - Storm32 & YS3 3X XML T6 **** W/ Big flashlight
Storm32 Software
OPTION 2: Electro Stunts - Storm32 StedyCam & YS3 3X XML T6 ***** Great Solution!!!
Storm32 StedyCam Software
OPTION 3: PERLE TV - 3 Axis DIY Handheld Gimbal & YS3 3X XML T6 **** Part 1/3
▻He uses same Storm32 StedyCam Software as OPTION 1
OPTION 4: tnxmatze - DIY Handheld Gimbal **** Little XML T6
OPTION 5: DIY Handheld 3axis Gimbal Stabilizer (without instructions)
OPTION 6: Cheap handheld 3axis gimbal - Storm32 board (Cheap Option w/out light hand)
OPTION 7: IWasHere - HAKRC Storm32 3 Axis Brushless Gimbal - GearBest
Storm32 Config file

Parts:
-HAKRC Storm32 3 Axis Brushless Gimbal Gopro3 / Gopro4 FPV Accessory (Aliexpress - $55)
-LED Flashlight YS3 3 x XML T6 1800 5 Modes Water Resistant 18650 LED (Aliexpress - $25)
-Joystick Controller HHG-JS for 3 Axis Basecam 8 32 Bits (Aliexpress - $10)

-Flashlight
http://www.banggood.com/Wholesale-E3-XM-L-T6-5-Modes-1600LM-Zoomable-LED-Flashlight-Suit-Set-2-x-18650-p-40234.html?p=PW08201889709201507X



Best handle(DIY) parts:
https://www.youtube.com/watch?v=3X6FxkMcF-k

Parts:
-Tripod
-USB Battery
-Swivel Torch Mount
-Mini Pocket Tripod Mount Stand Screw

GoPro USB Battery Grip DIY
https://www.youtube.com/watch?v=mnea-4-U4xo

https://www.youtube.com/watch?v=i0oZLogw7jY
Parts list:
- GoPro tripod mount - Can be bought at most places that sell GoPro accessories. Best Buy usually carries them or knock-offs can be bought on ebay.
- 1/2" CPVC pipe cap - Can be found at most hardware stores. DON'T buy a PVC cap. You want CPVC. They are different sizes.
- A short 1/4"-20 screw - This goes through the CPVC cap and into the GoPro tripod mount.
- One lock-on bicycle grip - These come in pairs only. Make sure you buy grips that have the locking rings on both ends of the grips. Can be found on Amazon.com, bicycle gear web sites, or your local bike shop.
- An external backup battery with USB charging outlet. This must be in the shape of a cylinder and have a diameter of 7/8" or 22mm.



From:
https://www.rcgroups.com/forums/showthread.php?1832271-DIY-Brushless-Gimbal-For-GoPro-Nex5

Low cost ,simple DIY project idea for "GoPro Brushless Gimbal",
Need little mod for adapting brushless motors, not finished mine yet, but developable,
I hope you like..

Part List:
Alexmos Simple Brushless Gimbal Controller or Opensource German Version
2-Axis Aluminium Aerial Photography PTZ from GLB 10$
1x Motor Mount from GLB 5$
1x HK 450 Carbon tail boom from HK 2.85$
2x Brushless Motors from HK Ready to use Brushless Gimbal Motors

-BaseCam (AlexMos) SimpleBGC
https://www.basecamelectronics.com/simplebgc/

Or

-Opensource German Version
https://code.google.com/archive/p/brushless-gimbal/

-GOPRO FPV Stability PTZ 2-Axis Aluminium Aerial Photography PTZ for Quadcopter - $10.66 SKU 90738
http://www.goodluckbuy.com/gopro-fpv-stability-ptz-2-axis-aluminium-aerial-photography-ptz-for-quadcopter-.html
Description:
- Type: Univerdal Two-axle Aerial Pan & Tilt
- Material: Aluminium
- Weight:64g(excluding servos)
- Silicon anti vibration
- For Quadcopter multicopter FPV system
- This set doesn't include Servos

Aluminum Brushless Motor 2212 2822 Mount for 12mm Fiber Glass Tube $5.74 SKU 77777
http://www.goodluckbuy.com/aluminum-brushless-motor-2212-2822-mount-for-12mm-fiber-glass-tube.html
Description:
- CNC made
- 6061 Aluminum material
- Used for 2212 2822 series motor
- Suited for 12mm glass/carbon Fiber tube
- Color:Black
- Weight: 9 gram
- Right part to built Muiticopter

-HK450 carbon tail boom €2.69
https://hobbyking.com/en_us/hk450-carbon-tail-boom.html
Description:
- HK450 carbon tail boom
- Length: 347mm
- Outer diameter: 12.45mm
- Inner diameter: 10.8mm



-GOPRO FPV 2-Axis Aluminium Photography PTZ with Two Sevos for Quadcopter $21.31 SKU 90739
http://www.goodluckbuy.com/gopro-fpv-2-axis-aluminium-photography-ptz-with-two-sevos-for-quadcopter-.html
Description:
- Type: Universal Two-axle Aerial Pan & Tilt
- Material: Aluminium
- Weight:127g(including two servos)
- Silicon anti vibration
- For Quadcopter multicopter FPV system
Package include:
- 1 x PTZ
- 1 x SG90 servo
- 1 x Gotech D9257 servo

-TowerPro SG90 9G Mini Servo with Accessories $3.28 SKU 52967
http://www.goodluckbuy.com/towerpro-sg90-9g-mini-servo-with-accessories.html
Description:
- Dimension : 22mm x 12mm x 29mm
- Weight : 9g
- Operating Speed : 0.12sec / 60 degrees (4.8V no load)
- Stall Torque : 1.5kg/cm at 4.8V
- Temperature Range : -30 to +60 Degree C
- Dead Band Width : 2 usec
- Operation Voltage : 3.0 - 7.2Volts
- Motor Type : coreless motor
- Gear Type : All Nylon Gear
- Connector Wire Length : 150mm



DJI Phantom Brushless Gimbal Camera Mount with Motor / GLB 3.1 2-Axis Brushless Gimbal MOS Controller for Gopro Hero 3 $30.34
http://www.xt-xinte.com/F07960.html