Tuesday, August 8, 2023

android usage - usb-tether

Suppose a person wants to cord-cut and obtain their internet access entirely from a tethered phone. Some of other posts have explained the configuration, but what about the data-plan? This is made somewhat inscrutable by the provider, so that a person tends toward ordering a larger plan. Let's look at the T-Mobile case.

somewhat mysterious

This is the information from the website. How much data do I use every month. At mid cycle am I at 22.28G usage, 25.08G usage, or 47.36G usage?

An hour on the 611 line with T-Mobile: the larger number, 25.08G, includes both hotspot and "voice" usage, this is my total number mid-cycle. T-Mobile uses "voice" to mean data they provide that is untethered. So "voice" isn't actually voice, it is eg., usage when driving around looking up the nearest gas station on one's phone. The 22.28G is the tethered "hotspot" usage: tethered to a laptop, a vehicle's Android connection, etc, and is the largest portion of the entire 25.08G. The untethered "voice" usage is 3.2G, the difference between the two larger numbers.

inflated values

Based on this, we can see I send about 3000 MMS/SMS a month, which would be about 100 per day. This is an overstated amount. I probably send about 25 texts per day. Similarly, they have me at about 1000 minutes of phone a month (33 mins daily) another overstatement, though not as grossly made.

But it's data that really matters to a cord cutter, b/c this is never unlimited. If my plan includes "40G hotspot", and I know I never use wifi, I just use tethering, then what is the 22.28G I have used? Is it part of the overall 25.08G used?

options online

The way we view it is important to our plan. It appears we need but how much more? Our bill will be roughly $115 per month if we cut the cord and need 100GB, or $90 per month if we can cut the cord and only need 50GB per month. But roughly, we can say to cut the cord, our costs are $100 per month phone and internet. For the gov't to track us.

usb-tether cam, mic, phone cam/mic (4G)

We might want to use and old phone as a separate video source from a different angle than a webcam. We might want to use a USB mic (not recommended w/out preamp), we migh have an extra USB cam lying about

  • /etc/udev/rules.d: as with all things USB, you'll have to identify the device and reload udev. Once you have this done, it will recognize he device when plugged in.
  • specialized software as with other linux projects, you'll probably need some software specific to that funciton

Turbo 2 - Android 7

Specs on this 4G 2015 phone include a 21MP camera- decent for video. It has about 21Gb free on the phone, but we can add up to a 64Gb microSDXC. Use at least a class 6 speed SDXC for 1080P. My original was stolen (probably at the T-Mobile outlet). A replacement was $8 (2022) for 32Gb Class 10 SanDisk.

What still works without the SIM? With a WiFi connection nearly everything but voice and text apps. Everything Google is a "go": Google Play Store, Voice etc., over Wi-Fi.

Most often, we'll just start and stop recording from the phone and download the file after. But what if we want to use it as a webcam, live via USB? Plugging in, we may get any number USB VID's based on what's chosen from the 5 phone options.

$ lsusb
Bus 001 Device 031: ID 22b8:2ea5 Motorola PCS XT1585
  • 2ea5 - "Charge this device", "Transfer files". If file transfer is selected, one can use...
    $ jmtpfs ~/mnt
    $ fusermount -u ~/mnt
    ...to move video and audio files off/on the device for further editing.
  • 2ea7 - "Transfer photos (PTP)". Don't know what PTP photo transfer is.
  • 18d1:4ee9 - "Use device as MIDI"
    $ lsusb
    18d1:4ee9 Google Inc. Nexus/Pixel Device (MIDI + debug)
    Not sure what a MIDI device is or how to use one.
  • 2e61 - "Software installation". ADB-type actions - root kits, side mounts, etc.

  • 2e25 - usb-tethered hotspot. This phone's decomissioned for hotpspotting phone data (SIM removed) but the switch is in Settings -> Wireless & networks -> More -> Mobile Hotspot & Tethering.

I could not find an option that did not require some software. I started with iVCam Webcam, which had some good instructions and might work for others. Ultimately, I found that, for Arch linux, I could yay. And of course you need to allow USB de-bugging.

This is possibly beneficial if seems to need a rule. Also may need to

# pacman -S v4l2loopback-dkms
installing v4l2loopback-dkms
(1/2) Arming ConditionNeedsUpdate...
(2/2) Install DKMS modules
==> dkms install --no-depmod v4l2loopback/0.12.5 -k 5.19.12-arch1-1
Deprecated feature: REMAKE_INITRD
==> depmod 5.19.12-arch1-1

# pacman -S v4l2loopback-utils

Monday, August 7, 2023

bibliography example

I've saved some articles and books, and put the references into a BIB file. I want a works cited (MLA) or references (APA) page at the end of an article I'm writing. What are the basics

The TEX file and the BIB file are joined at the hip and neither will compile if they're not entirely clean of syntactic errors. It's a state of near-continual anxiety.

1. the TEX file

# pacman -S texlive-bibtexextra

In the TEX heading...

\usepackage[style=mla,backend=bibtex]{biblatex}
\addbibresource{foo.bib}

In the TEX article, whenever we cite something we get the citations key number from the BIB file. In this case, lets say our citation for some article is "z023". Then...

\cite{z023}

At the end of the TEX file, just before "\end{document}"...

\printbibliography

2. The procedure

  1. check the BIB file for underscores and syntax errors. Jabref can sometimes help with this. If there are failures, just come back to this step and clean the BIB file again and again.
  2. ensure the BIB file is locatable in the \addlibresource filepath.
  3. run the TEX a first time, using the build menu "Latex -> PDF" option (pdflatex)
  4. run the TEX a second time, using the build menu "Bibtex" option (creates the BLG)
  5. run the TEX a third time using the "Latex -> PDF" option (pdflatex)

Sunday, August 6, 2023

library, bib, and pdflatex

Oh bibliographies. Yuck

do not use underscores in file names

Underscores are tidier than camel-case and I have relied on them over and over throughout the years. They met their match with LaTeX. I no longer use them for any filename in case I need to cite it in a LaTeX document.

old
20230705_smogreceipt
new
20230705smogreceipt

successful process

Using Geany or whatever...

  1. check the bib file for underscores and cleanness
  2. have the BIB file reachable by the filepath in \addlibresource
  3. run the TEX a first time, using the build menu "Latex -> PDF" option (pdflatex)
  4. run the TEX a second time, using the build menu "Bibtex" option (creates the BLG)
  5. run the TEX a third time using the "Latex -> PDF" option (pdflatex)

bibliography failures

Bibtex and/or pdflatex fail in different ways with underscores, but by far the worst problem is the cascade failure coming from bibtex. Pdflatex makes a call to bibtex and bibtex returns a BLG file. Any underscores in the "notes" field --eg filenames -- will be included, and pdflatext will reject the entire bibliography for one underscore. This is because pdflatex requires underscores to be preceeded by either a backslash or a $ (math mode). Sometimes an underscore from bibtex causes the entire PDF not to be written by pdflatex.

Accordingly, the data retention plan described in the prior post should not rely on filenaming using underscores. The URL field is the only exception. Bibtex or pdflatex will fail downstream

BIB specific fail

There's also a way bibtex can fail independently of pdflatex. In that case, it fails to send a BLG to pdflatex at all. This comes from the "crossreference" field often used by ppl to store notes about file locations of their saved journals and so on. When the Bibtex subroutine runs, it attempts to verify this location, even going through the Web or whatever. It's obviously not going to locate the thumbdrive folder that you left yourself a note about. And thus from one "crossref" failure, it will fail to produce a BLG file. Thus no bibliography.

BIB file include

Generally, author, title, date, url (can use underscores), DOI, abstract, pages, ISBN or ISSN. Leave out notes and crossref.

Populate your bib files with all the information to span whatever style you've decided upon (MLA, APA, etc), but never include or enter anything into the "crossref" field, which causes large problems when finally compiling via bibtex

This way, if a publisher does eventually look at the work, a person can reformat their TEX file to use that style of citation. Some of this is manual decision making.

Note that large organizations like grammarly.com probably are influencers and have inertia, so they might be a good resource to consider, eg this MLA v APA page. Works cited (MLA) and Reference (APA) is a key distinction. Frankly, I believe the format should be listed along with the title to keep people from being confused.

LaTeX integration of BIB

Once all of these are connected, how do we work them into our LaTeX documents. What codes do we need? How can we have consistent citations? For one thing, the document doesn't need to access the articles, just the BIB file. Yes, we need to look those, and typically save the research articles somewhere, but the document doesn't need any of that to compile, it just needs BIB file access.

In Arch, probably need the 37Mbbiblatex package to get anything to compile.

# pacman -S texlive-bibtexextra

More is described here, but the basics...

  • package -- \usepackage[style=mla,backend=bibtex]{biblatex}
  • BIB file -- underneath package \addbibresource {BIB filename}. Append the path to the filename if it's in a different directory.
  • Inline citations -- use \cite{[BIB item key]}. This can be alpha-numeric. No underscores of course.
  • Multiple BIBS -- described here.

bibliography checklist

NO UNDERSCORED ANYTHING IN ANY BIB FILE EXCEPT THE "URL" FIELD WITHIN ITS CURLY BRACES.

DO NOT SAVE ANY DOCUMENTS WITH UNDERSCORES, NOR NAME TEX OR BIB FILES WITH UNDERSCORES. Bibliographies will not print.

Order: pdflatex, bibtex, pdflatex.

Bibtex itself fails if any file in "crossref" field cannot be located within it.