├── LICENSE
├── README.md
├── docs
├── PCB_v1.1.0_back.png
├── PCB_v1.1.0_front.png
├── shield_front.jpg
├── shield_stacked.jpg
├── solenoid.png
├── transistor.png
├── wiring.png
└── wiring_2.5.0.jpg
├── microSD_content
├── 10
│ └── .gitignore
├── 11
│ └── .gitignore
├── 12
│ └── .gitignore
├── 13
│ └── .gitignore
├── 14
│ └── .gitignore
├── 15
│ └── .gitignore
├── 16
│ └── .gitignore
├── 17
│ └── .gitignore
├── 18
│ └── .gitignore
├── 19
│ └── .gitignore
├── 20
│ └── .gitignore
├── 21
│ └── .gitignore
├── 22
│ └── .gitignore
├── 23
│ └── .gitignore
├── 24
│ └── .gitignore
├── 25
│ └── .gitignore
├── 26
│ └── .gitignore
├── 27
│ └── .gitignore
├── 28
│ └── .gitignore
├── 29
│ └── .gitignore
├── 30
│ └── .gitignore
├── 31
│ └── .gitignore
├── 32
│ └── .gitignore
├── 33
│ └── .gitignore
├── 34
│ └── .gitignore
├── 35
│ └── .gitignore
├── 36
│ └── .gitignore
├── 37
│ └── .gitignore
├── 38
│ └── .gitignore
├── 39
│ └── .gitignore
├── 40
│ └── .gitignore
├── 41
│ └── .gitignore
├── 42
│ └── .gitignore
├── 43
│ └── .gitignore
├── 44
│ └── .gitignore
├── 45
│ └── .gitignore
├── 46
│ └── .gitignore
├── 47
│ └── .gitignore
├── 48
│ └── .gitignore
├── 49
│ └── .gitignore
├── 50
│ └── .gitignore
├── 51
│ └── .gitignore
├── 52
│ └── .gitignore
├── 53
│ └── .gitignore
├── 54
│ └── .gitignore
├── 55
│ └── .gitignore
├── 56
│ └── .gitignore
├── 57
│ └── .gitignore
├── 58
│ └── .gitignore
├── 59
│ └── .gitignore
├── 60
│ └── .gitignore
├── 61
│ └── .gitignore
├── 62
│ └── .gitignore
├── 63
│ └── .gitignore
├── 64
│ └── .gitignore
├── 65
│ └── .gitignore
├── 66
│ └── .gitignore
├── 67
│ └── .gitignore
├── 68
│ └── .gitignore
├── 69
│ └── .gitignore
├── 70
│ └── .gitignore
├── 71
│ └── .gitignore
├── 72
│ └── .gitignore
├── 73
│ └── .gitignore
├── 74
│ └── .gitignore
├── 75
│ └── .gitignore
├── 76
│ └── .gitignore
├── 77
│ └── .gitignore
├── 78
│ └── .gitignore
├── 79
│ └── .gitignore
├── 80
│ └── .gitignore
├── 81
│ └── .gitignore
├── 82
│ └── .gitignore
├── 83
│ └── .gitignore
├── 84
│ └── .gitignore
├── 85
│ └── .gitignore
├── 86
│ └── .gitignore
├── 87
│ └── .gitignore
├── 88
│ └── .gitignore
├── 89
│ └── .gitignore
├── 90
│ └── .gitignore
├── 91
│ └── .gitignore
├── 92
│ └── .gitignore
├── 93
│ └── .gitignore
├── 94
│ └── .gitignore
├── 95
│ └── .gitignore
├── 96
│ └── .gitignore
├── 97
│ └── .gitignore
├── 98
│ └── .gitignore
├── 99
│ └── .gitignore
├── 00
│ └── .gitignore
├── 01
│ └── .gitignore
├── 02
│ └── .gitignore
├── 03
│ └── .gitignore
├── 04
│ └── .gitignore
├── 05
│ └── .gitignore
├── 06
│ └── .gitignore
├── 07
│ └── .gitignore
├── 08
│ └── .gitignore
├── 09
│ └── .gitignore
└── MP3
│ ├── 0001.mp3
│ ├── 0002.mp3
│ ├── 0003.mp3
│ ├── 0004.mp3
│ └── 0005.mp3
├── shield
├── socotel_arduino_shield_gerber (with bells) v2.5.0.zip
└── socotel_arduino_shield_gerber.zip
└── socotel
└── socotel.ino
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # S63_Arduino : Ressusciter un téléphone à cadran S63 avec un Arduino et un player MP3
2 |
3 | Table des matières
4 | ==================
5 |
6 | * [introduction](#introduction)
7 | * [la mission : un téléphone musical qui vous joue un tube de votre année de naissance !](#la-mission--un-téléphone-musical-qui-vous-joue-un-tube-de-votre-année-de-naissance-)
8 | * [mission (im)possible ?](#mission-impossible-)
9 | * [commençons par le facile : la lecture de fichiers MP3](#commençons-par-le-facile--la-lecture-de-fichiers-mp3)
10 | * [plus compliqué, le S63](#plus-compliqué-le-s63)
11 | * [ça se complique encore (et on s'émerveille ✨) avec le cadran](#ça-se-complique-encore-et-on-sémerveille-sparkles-avec-le-cadran)
12 | * [des fils, des connexions, un peu de code et la magie prend forme](#des-fils-des-connexions-un-peu-de-code-et-la-magie-prend-forme)
13 | * [plan de connexion](#plan-de-connexion)
14 | * [le code, justement](#le-code-justement)
15 | * [spécifications / comportement attendu](#spécifications--comportement-attendu)
16 | * [plus de détails sur le code ?](#plus-de-détails-sur-le-code-)
17 | * [la carte micro SD et le module MP3](#la-carte-micro-sd-et-le-module-mp3)
18 | * [adaptation à notre cas d'usage](#adaptation-à-notre-cas-dusage)
19 | * [et les tonalités ?](#et-les-tonalités-)
20 | * [copyright ?](#copyright-)
21 | * [c'est bien beau, ça marche, mais c'est pas pratique pour tout mettre dans le S63](#cest-bien-beau-ça-marche-mais-cest-pas-pratique-pour-tout-mettre-dans-le-s63)
22 | * [un shield ?](#un-shield-)
23 | * [comment on fait un shield ?](#comment-on-fait-un-shield-)
24 | * [je peux en avoir un ?](#je-peux-en-avoir-un-)
25 | * [et alors, ça fait quoi à la fin ?](#et-alors-ça-fait-quoi-à-la-fin-)
26 | * [et pour le mettre dans le S63 ?](#et-pour-le-mettre-dans-le-s63-)
27 | * [On va plus loin ? On peut le faire sonner ?](#on-va-plus-loin--on-peut-le-faire-sonner-)
28 | * [un solénoïde ?](#un-solénoïde-)
29 | * [pilotage du solénoïde avec l'Arduino](#pilotage-du-solénoïde-avec-larduino)
30 | * [et du coup, coté shield, ca donne quoi ?](#et-du-coup-coté-shield-ca-donne-quoi-)
31 | * [et coté code et comportement attendu ?](#et-coté-code-et-comportement-attendu-)
32 | * [donc il faut ajouter une chanson dans la carte SD](#donc-il-faut-ajouter-une-chanson-dans-la-carte-sd)
33 | * [responsabilités](#responsabilités)
34 | * [envie d'aller plus loin ?](#envie-daller-plus-loin-)
35 | * [Questions / Réponses / Divers](#questions--r%C3%A9ponses--divers)
36 | * [A quoi sert le 4e fil du cadran ?](#à-quoi-sert-le-4e-fil-du-cadran-)
37 | * [Remerciements et références](#remerciements-et-références)
38 |
39 |
40 | ## introduction
41 |
42 | Commençons par rendre à César...
43 |
44 | Ce projet a démarré lorsque j'ai vu un prototype de Socotel S63 que mon ami [Cyril Jovet](https://github.com/sun-exploit "Cyril Jovet") a fait revivre, vraisemblablement grâce au code de [revolunet](http://github.com/revolunet/s63 "@revolunet").
45 |
46 | Merci à vous deux !
47 |
48 | C'est donc en voyant un vieux vieux téléphone revivre avec un Raspberry que je me suis lancé le défi de faire fonctionner un S63 avec un Arduino.
49 |
50 | ***Pourquoi ?***
51 |
52 | Pour le challenge, pour découvrir plein de choses : faire du son, jouer des mp3, s'interfacer avec du matériel vintage, créer un shield Arduino, et aussi pour avoir une solution "plus simple", moins puissante qu'un Raspberry (luxueux, d'après moi, pour répondre à ce besoin), et pour diviser les couts de matériel/fabrication par 10 !
53 |
54 | ***Mais encore ?***
55 |
56 | C'est aussi une expérience personnelle de transmission de compétences, de vulgarisation du code, d'initiation aux Arduino et à l'électronique.
57 |
58 | C'est pourquoi cette page est particulièrement longue : au delà de l'évident partage Open Source, j'essaie de retracer tout mon parcours, montrer tout ce que j'ai appris et l'émerveillement que cela m'a apporté. Et aussi de permettre à un maximum de personnes de découvrir et comprendre comment ça marche !
59 |
60 |
61 | ## la mission : un téléphone musical qui vous joue un tube de votre année de naissance !
62 |
63 | L'idée est à la fois géniale et très simple : utiliser un S63 pour numéroter son année de naissance (4 chiffres), et le téléphone joue alors une chanson emblématique de cette année là (et celle là, c'était en 1976, pour l'anecdote :grimacing:)
64 |
65 | Une fois encore, ce n'est pas *mon* idée, et je ne sais pas exactement qui l'a eue. Je me suis contenté de produire une solution qui reproduit ce fonctionnement, avec un Arduino.
66 |
67 |
68 | ## mission (im)possible ?
69 |
70 | Avant toute chose, il faut savoir si le projet est réaliste. Et pour celà, je vois 3 difficultés :
71 | - jouer un MP3 avec un Arduino
72 | - capter les impulsions d'un cadran téléphonique
73 | - arriver à faire marcher le tout ensemble, Arduino, S63, MP3, décrocher, raccrocher, numéroter, etc...
74 |
75 | ### commençons par le facile : la lecture de fichiers MP3
76 |
77 | Quelques recherches sur Internet, et cela semble assez simple :
78 | - le hardware : https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299
79 | - le software : https://github.com/DFRobot/DFRobotDFPlayerMini/
80 |
81 | Un peu plus de recherches (histoire de voir que ce module se trouve aussi un peu partout sous le nom de "MP3-TF-16P", une carte bleue qui chauffe (pas beaucoup, moins d'1€ !), et il n'y a plus qu'à attendre la livraison !
82 |
83 | Pas de surprise, on cherche le schéma de montage (https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299#Connection_Diagram).
84 |
85 | On assemble, [on bricole un peu avec la carte micro SD](#la-carte-micro-sd-et-le-module-mp3), et... ça marche :-)
86 |
87 | ### plus compliqué, le S63
88 |
89 | J'ai sous la main un vieux téléphone à cadran et... Internet ! J'ai longuement cherché de la documentation sur le câblage et le fonctionnement du téléphone (et plus précisément du cadran), mais force est de constater que je n'ai rien trouvé de bien probant. Finalement, c'est bien [revolunet](http://github.com/revolunet/s63) qui est le plus clair et le plus complet dans tout ce que j'ai pu trouver sur le S63.
90 |
91 | C'est pas mal, ça peut me permettre de démarrer, mais dans le doute j'ai quand même ouvert mon S63, pour le passer au multimètre et me faire mon opinion.
92 |
93 | Pas de surprise, et effectivement, je confirme quelques informations capitales de [revolunet](http://github.com/revolunet/s63) :
94 | - on détecte le décrocher/raccrocher via les connexions 7 et 11 du S63
95 | - le haut parleur est sur les connexions 3 et 5 (et les 2 et 4 aussi, pour l'écouteur supplémentaire, mais c'est déjà précablé)
96 |
97 | ### ça se complique encore (et on s'émerveille :sparkles:) avec le cadran
98 |
99 | Le S63 est une merveille d'ingénierie, et son cadran l'est encore plus.
100 |
101 | Je fais ici un petit aparté :
102 |
103 | *En tant qu'ingénieur travaillant chez Orange, j'avais un peu l'impression, en inspectant ce téléphone,
104 | de passer sur les traces de mes pairs, et j'avoue que j'ai senti une grande fierté de faire partie
105 | de la grande famille de l'ingénierie chez l'opérateur historique. Je souhaite ici rendre
106 | hommage à mes illustres prédécesseurs : La qualité de fabrication du S63 (sa longévité en témoigne) sa
107 | simplicité d'utilisation et l'ingéniosité des mécanismes (en particulier le cadran) forcent le respect.*
108 |
109 | Le cadran est, donc, une merveille. Hélas, 4 fils en sortent et il y en a un dont je n'ai pas réussi à percer le mystère.
110 |
111 | Mais avec mon multimètre (et l'aide de http://jla.1313-blog.overblog.com/2017/09/convertisseur-dc/dtmf.html) voici comment fonctionnent les 3 autres :
112 | - **I : les impulsions téléphoniques (66ms toutes les 100ms, désolé, je retrouve plus ma source :cry: )**
113 | - **II : la masse**
114 | - **III : interrupteur ouvert lorsqu'un chiffre est en cours de composition (lorsqu'on tourne le cadran).**
115 |
116 | NB : oui le S63 propose un marquage en chiffres romains pour les fils du cadran, pour se démarquer et éviter de confondre avec l'autre bornier. Cela va me causer quelques soucis plus tard, car il est facile de confondre 11 et II (j'y reviendrai).
117 |
118 | Autre petit aparté :
119 |
120 | *le cadran fonctionne avec un ressort. Comment faire pour que lorsqu'on compose un 0
121 | le cadran aille à la même vitesse (et envoie donc les impulsions de même durée) que lorsqu'on compose un 1,
122 | alors que le ressort sera beaucoup plus remonté ?*
123 |
124 | *Les ingénieurs ont pensé à un mécanisme très simple mais incroyablement efficace, un régulateur de vitesse !
125 | Je vous laisse lire et voir les photos ici : http://jla.1313-blog.overblog.com/s-63-a-cadran-sur-freebox*
126 |
127 | Reste à voir si mon Arduino va réussir à détecter correctement les impulsions.
128 |
129 |
130 | ## des fils, des connexions, un peu de code et la magie prend forme
131 |
132 | Une fois les fils correctement identifiés, la connexion est plutôt simple.
133 |
134 | On va se servir des [pullup](https://www.arduino.cc/en/Tutorial/DigitalPins "résistances de pullup des Arduino") pour nous simplifier la vie sur la détection du "décrocher/raccrocher" et du "numérotation en cours".
135 |
136 | Pour les impulsions du cadran, on va brancher le fil concerné (le I donc) sur la patte 2, qui permet de gérer les [interruptions](https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/ "interruptions"), ce qui est nécessaire pour éviter de louper une impulsion. En résumé, une interruption intervient chaque fois qu'une impulsion est détectée, et déclenche un morceau de code (appelé "callback"), qui va incrémenter un compteur.
137 |
138 | Pour le haut parleur, on connecte les pattes SPK1 et SPK2 du player MP3 aux bornes 3 et 5 du S63.
139 |
140 | Une petite subtilité : pour le "décrocher/raccrocher", une partie du circuit électrique du S63 est reliée au cadran. J'ai constaté que cela posait problème si la borne 7 n'était pas connectée à la masse. Dont acte, c'est donc la borne 11 qui transmettra le signal "décrocher/raccrocher".
141 |
142 | ### plan de connexion
143 |
144 | :exclamation: NB : comme déjà évoqué précédemment, il est très facile de confondre 11 et II, soyez vigilants dans vos montages !
145 |
146 | |Arduino | S63 | MP3
147 | |--------|----------|----------
148 | | 2 | I |
149 | | 4 | III |
150 | | 5 | 11 |
151 | | 10 | | TX
152 | | 11 | | RX (+1kΩ resistor en serie)
153 | | +5V | | VCC
154 | | GND | II / 7 | GND
155 | | | 3 | SPK1
156 | | | 5 | SPK2
157 |
158 |
159 | On peut même imaginer/anticiper un bornier sur la breadboard (*spoil : ou anticiper la fabrication un circuit imprimé !*), ainsi :
160 |
161 | | breadboard | S63 |
162 | |------------|----------|
163 | | 1 (gauche)| 11 |
164 | | 2 | III |
165 | | 3 | I |
166 | | 4 | 3 |
167 | | 5 | 7 |
168 | | 6 | 5 |
169 | | 7 (droite) | II |
170 |
171 |
172 | Et un schéma associé (merci [Fritzing](https://fritzing.org "Fritzing"))
173 |
174 | 
175 |
176 |
177 | Et voilà ! La magie opère, avec mon petit code de test, j'entends bien un MP3 dans le combiné ! :heart_eyes:
178 |
179 | Et pareil en testant le décrocher/raccrocher, le cadran qui numérote, et ... les chiffres / impulsions ! Le code avec les interruptions fonctionne à merveille !
180 |
181 |
182 | ## le code, justement
183 |
184 | C'est bien beau, on a un code de test, on arrive à détecter les actions physiques sur le téléphone, et à jouer un (unique) morceau de musique dans le combiné.
185 |
186 | ### spécifications / comportement attendu
187 |
188 | Nous allons donc maintenant nous lancer dans la partie "faire revivre" le téléphone. Il va donc falloir coder le fonctionnement suivant :
189 | - lorsque le téléphone est raccroché, rien ne se passe, et cela le remet dans son état initial
190 | - lorsqu'on décroche, on entend la tonalité pendant 10 secondes
191 | - si au bout de ces 10 secondes, aucun chiffre n'est composé, on joue la tonalité d'occupation puis on attend indéfiniment (il faut donc raccrocher)
192 | - si un chiffre est composé pendant les 10 secondes, alors :
193 | - on arrête la tonalité
194 | - on mémorise ce chiffre
195 | - on attend 10 secondes avant de lancer l'appel (pour permettre de numéroter un autre chiffre)
196 | - si on a saisi 4 chiffres alors on réduit fortement le délai d'attente pour lancer rapidement l'appel, car on a là une année de naissance, à priori. Donc plus besoin d'attendre un nouveau chiffre numéroté.
197 | - on vérifie que l'appel va aboutir :
198 | - est-ce que la date de naissance est valide ?
199 | - est-ce que sur la carte mémoire, nous avons un dossier contenant des mp3 pour cette année ?
200 | - en cas de réponse négative à l'une des deux questions, on joue la tonalité d'erreur et on arrête tout (il faut alors raccrocher)
201 | - on lance l'appel :
202 | - on simule un appel longue distance, on joue donc la tonalité d'acheminement pendant 3 secondes
203 | - on joue ensuite la tonalité de sonnerie pendant 6 secondes
204 | - puis... on décroche et on joue une chanson aléatoire parmi celles qui sont disponibles dans le dossier correspondant à l'année composée.
205 |
206 |
207 | ***Simple, non ?***
208 |
209 | En fait, pas tant que cela, vu qu'on utilise un micro-contrôleur, et donc que le code est dans une boucle infinie.
210 | J'ai donc opté pour une "machine à état". Je mémorise l'état dans lequel le téléphone est actuellement, et je teste cet état afin de jouer le bon morceau de code en fonction de la situation.
211 |
212 | ### plus de détails sur le code ?
213 |
214 | "La vérité est dans le code" comme on dit souvent :smiley: (en tout cas, chez moi on le dit :grimacing:)
215 |
216 | Si vous voulez en savoir davantage, le code implémente exactement le fonctionnel vu ci-dessus, est massivement documenté et j'espère qu'il est lisible ! Je suis preneur de tout commentaire, retour, amélioration, évidemment !
217 |
218 | Et le code, évidemment, il est là : [socotel](./socotel/socotel.ino)
219 |
220 |
221 | ## la carte micro SD et le module MP3
222 |
223 | [Le module MP3](#commen%C3%A7ons-par-le-facile--la-lecture-de-fichiers-mp3) est formidable (pour son prix) ! Il inclut :
224 | - un lecteur de carte micro SD
225 | - un décodeur MP3
226 | - un convertisseur analogique (DAC)
227 | - un égaliseur (equalizer)
228 |
229 | Hélas, il a quelques limitations, qui nous obligent à quelques contorsions dans le code. Les voici :
230 | - les dossier doivent être **exclusivement** composés de 2 chiffres (01-99)
231 | - les fichiers doivent être **exclusivement** composés de 3 chiffres (001-255)
232 | - il y a un cas particulier pour les 10 premiers dossiers, qui peuvent prendre des fichiers dans l'intervalle 0001-1000 (avec un appel à une fonction différente, hélas)
233 | - il y a deux dossiers spéciaux "MP3" et "ADVERT", qui acceptent des fichiers dans l'intervalle 0000-65535, qui utilisent une fonction différente des dossiers standard pour y accéder. Et dans le cas de "ADVERT", la musique précédant l'appel reprend après la fin du son joué (c'est manifestement une fonction utilisée dans les commerces pour faire de la pub, puis reprendre la chanson là ou elle était...).
234 |
235 | ### adaptation à notre cas d'usage
236 |
237 | Dans notre cas, nous voilà bien embêtés, car il est impossible de stocker les années simplement. Nous allons donc nous donner 100 ans glissants, et choisir à quel moment on change de siècle entre les dossiers 01 et 99.
238 |
239 | Dans le code, j'ai opté pour une plage de fonctionnement entre 1940 et 2017 inclus. En conséquence, le dossier 01 est pour 2001, le 17 pour 2017, le 40 est pour 1940, le 99 pour 1999.
240 |
241 | Reste le cas de l'an 2000, vu que le module n'accepte pas le dossier "00". (tiens, ça faisait longtemps qu'on avait pas eu un bug de l'an 2000 ! :grimacing:)
242 |
243 | Qu'à cela ne tienne, vu qu'entre 2017 et 1940 j'ai 32 dossiers libres, je vais en utiliser un, disons 1940-1 => 39 comme dossier pour l'an 2000...
244 | Oui, c'est très moche, j'ai honte :sweat:, tout ça... mais c'est surement le moins compliqué à implémenter dans le code.
245 |
246 | Pour le reste, ça devient simple, un dossier par année, des fichiers numérotés pour chaque dossier et c'est parti :
247 | ```
248 | 40/001.mp3
249 | 40/002.mp3
250 | 40/003.mp3
251 | 41/001.mp3
252 | 41/002.mp3
253 | ...
254 | ```
255 | **cela va sans dire...** : mais pour des raisons évidentes de droits d'auteur, je ne fournis évidemment aucun fichier mp3 relatif aux chansons et années. A vous de déposer vos fichiers préférés dans les dossiers correspondants (et avec les numéros ad-hoc).
256 |
257 | **Petit bonus** : le code que je fournis gère de lui même le nombre de fichiers dans les dossiers et en choisit un au hasard au moment de jouer la musique. Pas la peine d'avoir le même nombre de chansons dans chaque dossier, donc.
258 |
259 | ### et les tonalités ?
260 |
261 | Les tonalités sont dans le dossier spécial ["MP3"](./microSD_content/MP3).
262 | - 0001.mp3 => tonalité d'accueil (le son continu lorsqu'on décroche, avant de numéroter)
263 | - 0002.mp3 => tonalité d'occupation
264 | - 0003.mp3 => tonalité d'acheminement
265 | - 0004.mp3 => tonalité de sonnerie
266 | - 0005.mp3 => tonalité d'erreur d'acheminement.
267 |
268 | Vous retrouverez tous ces fichiers et l'arborescence décrite ci-dessus dans le dossier [microSD_content](./microSD_content/) de ce dépôt.
269 |
270 | #### copyright ?
271 |
272 | Mais d'où viennent ces MP3 de tonalités ?
273 |
274 | Là, je tiens à remercier https://www.orange.com/fr/content/download/3635/33162/version/1/file/STI03-ed4_0505.pdf, qui décrit toutes les spécifications des tonalités de l'époque !
275 |
276 | A partir de ces spécifications, j'ai moi même reproduit ces sons grâce à l'excellent [Audacity](https://www.audacityteam.org), avec lequel c'est d'une simplicité incroyable de générer des sons lorsqu'on connait les durées et les fréquences. :thumbsup:
277 |
278 | Du coup... ces MP3 sont les miens. Je les mets à disposition de ce programme, et sous licence GPL, évidemment. :sunglasses:
279 |
280 |
281 | Nouvel aparté :
282 |
283 | *la tonalité d'accueil du téléphone (le fichier [0001.mp3](./microSD_content/MP3/0001.mp3)) est un "La 3" comme l'appellent les musiciens. C'est un signal sonore de fréquence 440Hz. Sa particularité ? C'est **LE** "La", celui qu'on entend au diapason, celui qu'on utilise pour accorder un instrument !*
284 | *Eh oui, en cas de besoin, on pouvait se servir d'un téléphone pour s'accorder ! Quel heureux hasard ! Ou plutôt, merci à ceux qui l'ont conçu comme cela !*
285 |
286 |
287 | ## c'est bien beau, ça marche, mais c'est pas pratique pour tout mettre dans le S63
288 |
289 | Oui... à ce stade du projet, on a un montage qui fonctionne, du code qui reproduit le fonctionnement de l'époque et une carte mémoire avec tout ce qu'il faut.
290 |
291 | Souci, ça fait des fils partout, c'est pas super pratique, ça va se débrancher et ça va pas rentrer dans le S63.
292 |
293 | Du coup, c'est là qu'on va parler des [shields](https://www.arduino.cc/en/Main/arduinoShields) !
294 |
295 |
296 | ## un shield ?
297 |
298 | Un shield c'est un circuit imprimé qui est exactement de la taille de l'Arduino, avec les mêmes connexions et qui vient se brancher au dessus de lui.
299 |
300 | Cela permet, notamment, d'inclure des circuits, connexions et autres sur un circuit imprimé, qui va se fixer sur les pattes de l'Arduino, et donc éviter d'avoir plein de fils volants, et mieux, d'éviter d'avoir quoi que ce soit à câbler !
301 |
302 | On prend le shield, on le fixe et... ça marche !
303 |
304 | Bon... dans notre cas, il va falloir quand même souder les connexions au S63. Mais toutes les connexions au lecteur MP3 vont être intégrées.
305 |
306 | L'avantage c'est qu'on évite les plaques à essais, les fils volants et qu'on gagne de la place !
307 |
308 | L'autre avantage, c'est qu'on ne peut plus se tromper dans le câblage (ou presque ... [rappelez vous du 11 vs II !](#plan-de-connexion) )
309 |
310 | Concrètement, le shield pour notre projet, cela ressemble à ça :
311 |
312 | 
313 |
314 | et à ça :
315 |
316 | 
317 |
318 |
319 | ### comment on fait un shield ?
320 |
321 | Concrètement, j'ai documenté mon montage dans [Fritzing](https://fritzing.org "Fritzing") (voir [plan de connexion](#plan-de-connexion), et grâce au même outil, j'ai ensuite conçu le schéma du shield et son routage électrique.
322 |
323 | J'ai alors exporté le résultat dans un format exploitable par les professionnels du circuits imprimé (le format "gerber") que j'ai ensuite fait imprimer/fabriquer.
324 |
325 |
326 | ### je peux en avoir un ?
327 |
328 | Si vous voulez vous faire votre shield, vous trouverez tout ce qu'il faut pour l'imprimer (format gerber, donc) dans le dossier [shield](./shield). Vous trouverez facilement sur internet des sites pour imprimer des circuits (cherchez "PCB maker").
329 |
330 | Si vous préférez, j'ai un peu de stock et je peux vous faire parvenir un shield (nu évidemment, à vous de vous procurer et souder les composants), moyennant le remboursement des frais de transport et de fabrication. [Contactez-moi si besoin](https://twitter.com/thomas_chappe)
331 |
332 | Concernant les pièces à ajouter / souder, il vous faudra :
333 | - [un lecteur MP3](#commen%C3%A7ons-par-le-facile--la-lecture-de-fichiers-mp3), évidemment.
334 | - une résistance de 1kΩ
335 | - des connecteurs pour shield [de ce genre là (par exemple)](https://snootlab.com/connecteurs/170-kit-connecteurs-empilables-arduino-1.html)
336 | - des fils électriques de base (j'ai une préférence pour les fils multicolores "Dupont") pour connecter le S63 au shield.
337 | - optionnellement, des "cosses fourche" pour se brancher proprement coté S63.
338 |
339 |
340 | ## et alors, ça fait quoi à la fin ?
341 |
342 | A la fin, ça ressemble à ça (ancienne version du shield mais même principe) :
343 |
344 | 
345 |
346 | et lorsqu'on l'empile sur un Arduino :
347 |
348 | 
349 |
350 |
351 |
352 | ### et pour le mettre dans le S63 ?
353 |
354 | Pensez à acheter un adaptateur 230v-9v pour Arduino, afin de l'alimenter directement sur une prise secteur. Il n'y a alors qu'un petit fil à faire sortir du S63 pour qu'il fonctionne.
355 |
356 | Et mettez votre montage (Arduino + shield) dans un emballage antistatique (en général les Arduino sont vendus emballés dedans) afin de ne pas faire de court-circuit avec l'intérieur du S63.
357 |
358 |
359 |
360 |
361 | ## On va plus loin ? On peut le faire sonner ?
362 |
363 | Oui ! :smiley:
364 |
365 | Dans la version 2.0.0 du code, une partie **optionnelle** a été ajoutée, ainsi qu'un shield approprié [version 2.5.0](./shield/socotel_arduino_shield_gerber%20(with%20bells)%20v2.5.0.zip) pour faire sonner le S63.
366 |
367 | J'ai bien dit **optionnelle** : tout ce qui est décrit avant fonctionnera parfaitement avec la dernière version du code ou du shield, même si vous ne mettez pas en place les élément décrits ci-dessous et que vous ne voulez pas faire sonner le téléphone.
368 |
369 | J'ai pris l'initiative de ne PAS utiliser le moteur et le carillon d'origine du téléphone, car il fonctionne en 48V (d'après les informations que je trouve sur le net...) et que je n'avais pas envie de gérer un transformateur électrique (cout, encombrement...), ou pire, faire entrer du 230V dans le téléphone.
370 |
371 | Du coup, un collègue (:wave: Yann G, si tu me lis !) m'a soufflé une excellente idée : utiliser des solénoïdes !
372 |
373 | C'est un peu dommage car on ne réutilise pas l'existant, mais c'est beaucoup plus sûr que de jouer avec le courant !
374 |
375 | ### un solénoïde ?
376 |
377 | Oui, des solénoïdes ! Ces petites bobines qui font se déplacer un percuteur !
378 | Une photo (merci AliExpress !) vaut mieux qu'un long discours :
379 | 
380 |
381 | Du coup, il suffit d'en placer un à coté de chacune des cloches du téléphone, de les fixer à la distance adéquate avec un pistolet à colle et le tour est joué... ou presque ! Il faut les piloter avec l'Arduino maintenant !
382 |
383 | ### pilotage du solénoïde avec l'Arduino
384 |
385 | Un solénoïde (une bobine), ça consomme pas mal de courant. Et donc les pattes des Arduino, avec leurs 50mA maximum, ça va pas suffire.
386 |
387 | Du coup, il faut brancher le solénoïde directement sur le +5V de l'Arduino (qui fournit beaucoup plus de courant et est directement relié à l'alimentation de l'Arduino). Oui, mais là... on ne le pilote plus !
388 |
389 | C'est là qu'arrive encore un nouvel ami électronique : le transistor !
390 |
391 | Dans notre cas, il va servir d'interrupteur. Je ne rentre pas dans les détails (d'ailleurs, je ne maitrise pas tout !) mais en gros, si on envoie du courant sur la base (B) d'un transistor, alors entre l'émetteur (E) et le collecteur (C), le courant passe.
392 |
393 | Un transistor, cela a donc 3 pattes, et ça ressemble à ça :
394 | 
395 |
396 | Parfait ! Il suffit alors de brancher la base sur une patte de notre Arduino, et de faire un circuit électrique entre le +5V, le solenoïde, et le transistor pour pouvoir programmer tout ça !
397 |
398 | Bon il faut une résistance et une diode en plus, pour des histoires de spécifications et de retour de courant, mais c'est des détails (ou pas, ça peut griller votre Arduino si vous les mettez pas...).
399 |
400 | ### et du coup, coté shield, ca donne quoi ?
401 |
402 | Comme dit précédemment : ces composants sont **optionnels** et ne servent **que** pour faire sonner le téléphone.
403 |
404 | Partez de la [version 2.5.0 du shield](./shield/socotel_arduino_shield_gerber%20(with%20bells)%20v2.5.0.zip) pour avoir tous les circuits nécessaires.
405 |
406 | Concernant les pièces à ajouter et souder pour que cela sonne, il vous faudra :
407 | - 2 résistances de 1kΩ
408 | - 2 diodes 1N4004
409 | - 2 transistor TIP102
410 | - 2 solénoïdes 5V [exemple ici](https://www.aliexpress.com/item/32801392552.html)
411 |
412 |
413 | Et le montage complet, concrètement, c'est ça :
414 | 
415 |
416 | ### et coté code et comportement attendu ?
417 |
418 | J'ai ajouté un comportement supplémentaire dans le code :
419 | - si on compose un numéro spécial (par défaut c'est le 0666 :metal:)
420 | - le téléphone joue MP3 spécial (pour indiquer à l'utilisateur que la consigne est bien reçue).
421 | - Lorsque le téléphone est raccroché, alors il attend un délai (paramétrable),
422 | - puis... il sonne !
423 | - Lorsque vous décrochez, il reprend son fonctionnement normal : tonalité habituelle, attente de la numérotation d'une année.
424 | - Si vous ne décrochez pas, il s'arrête de sonner après un nombre de sonneries paramétrable dans le code.
425 |
426 | **Petit bonus** : Bien évidemment, j'ai à nouveau récupéré les spécifications et durées des sonneries d'époque, et ce sont donc les durées d'origine (et leur nombre) qui sont utilisées par défaut dans le code ! Vous allez voir (ou entendre plutôt !), ça rappelle des souvenirs de l'entendre sonner !
427 |
428 | ### donc il faut ajouter une chanson dans la carte SD
429 |
430 | Oui, un fichier MP3 de votre choix pour que le téléphone vous indique que votre appel au numéro spécial a bien été pris en compte.
431 |
432 | Comme expliqué précédemment, les tonalités sont dans le dossier spécial ["MP3"](./microSD_content/MP3).
433 |
434 | Il faut donc y ajouter un fichier :
435 | - 0006.mp3 => son de prise en compte de demande d'appel / sonnerie
436 |
437 |
438 |
439 | ## responsabilités
440 |
441 | Je suis un bricoleur / bidouilleur / geek / passionné, mais je ne suis pas un professionnel de l'électricité ni de l'électronique. Il est donc possible qu'il y ait des imperfections ou défauts dans toute cette expérimentation. Il est également possible que les modules utilisés soient défaillants ou fonctionnent de manière inattendue.
442 |
443 | En utilisant les différents éléments et informations proposés ici, vous engagez votre propre et entière responsabilité et je ne saurai être retenu responsable de quelque conséquence que ce soit pour l'utilisation des éléments que je fournis ici.
444 |
445 | Merci pour votre compréhension, vive l'Open Source et vive le partage de connaissances !
446 |
447 |
448 | ## envie d'aller plus loin ?
449 |
450 | Je me suis arrêté là pour cette expérimentation, qui me semble déjà bien complète et qui m'a occupé bien plus longtemps que ce que je ne l'imaginais !
451 |
452 | Cependant, j'avais encore quelques idées, peut-être que j'y reviendrai plus tard, mais en attendant, s'il y a des personnes qui veulent reprendre le flambeau, les voici :
453 | - remplacer les mp3 de tonalité par des appels à la fonction [tone de l'Arduino](https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/)
454 | - brancher la sonnerie du téléphone (voir ce que fait [revolunet](http://github.com/revolunet/s63 "@revolunet") à ce sujet) mais c'est assez dangereux (230v etc...) Voir juste au dessus ! [On va plus loin ? On peut le faire sonner ?](#on-va-plus-loin--on-peut-le-faire-sonner-)
455 | - inventer un cas d'usage où il serait intéressant de le faire sonner, aussi...
456 | - remplacer l'Arduino par un ESP8266 pour permettre une connectivité wifi et ouvrir une toute autre dimension (pilotage d'API sur internet, modifier/ajouter des mp3 sur la carte microSD à distance, IoT, allumer la lumière, communiquer à plusieurs téléphones, voire communication VoWifi ?).
457 | - cela nécessite certainement de revoir le shield car les pattes des ESP8266 sont différentes de celles de l'Arduino...
458 | - Adapter la fiche T du téléphone pour alimenter le circuit directement avec cette prise ou à défaut, la couper et réutiliser le fil, pour éviter d'ajouter un fil qui sort du S63 pour l'alimenter.
459 | - trouver à quoi sert le 4e fil du cadran voir ci dessous [A quoi sert le 4e fil du cadran ?](#à-quoi-sert-le-4e-fil-du-cadran-)
460 | - ajouter une prise jack pour pouvoir connecter une enceinte et transformer le téléphone en player mp3, avec un code alternatif :
461 | - stocker des playlist dans les dossiers
462 | - lorsqu'on compose un numéro (1 ou 2 chiffres), cela joue la playlist (tout les mp3 du dossier numéroté).
463 |
464 |
465 | ## Questions / Réponses / Divers
466 | ### à quoi sert le 4e fil du cadran ?
467 | "Son rôle est de shunter la sonnerie pour éviter les tintements de celle-ci lors de la numérotation. La sonnerie est alimentée normalement par du 80v alternatif envoyé par le central (c'était du 110v dans les premiers centraux). Le condensateur en entrée bloque le 48v continu fourni par la ligne et laisse passer le courant d'appel. Lors de la numérotation, l'ouverture/fermeture de la ligne par le cadran passe le condensateur et fait tinter la sonnerie. Le shunt permet d'éviter ça. Celui-ci est d'ailleurs déporté au niveau du conjoncteur par le fil rouge (borne 17 sur le S63 de mémoire) pour la sonnerie extérieure et via le câblage la sonnerie des autres postes montés en parallèle s'il y en a." [Jacques-F](https://github.com/ThomasChappe/S63_Arduino/issues/2#issuecomment-2427249708)
468 |
469 | ## Remerciements et références
470 |
471 | - [Cyril Jovet](https://github.com/sun-exploit "Cyril Jovet") évidemment, sans qui je n'aurais jamais découvert l'idée d'adapter un S63
472 | - [@revolunet](https://github.com/revolunet "@revolunet") pour l'idée originale et la documentation (schémas, images) sur son github
473 | - [@DFRobot](https://github.com/DFRobot/DFRobotDFPlayerMini/) pour sa bibliothèque de prise en charge du player MP3.
474 | - [Jacques-F](https://github.com/ThomasChappe/S63_Arduino/issues/2#issuecomment-2427249708) pour sa réponse à l'utilité du 4e fil du cadran.
475 | - http://jla.1313-blog.overblog.com/ : énorme base documentaire, découvertes et expérimentations qui m'ont passionné et bien aidé !
476 | - https://www.orange.com/fr/content/download/3635/33162/version/1/file/STI03-ed4_0505.pdf : toutes les spécifications des tonalités de l'époque !
477 |
478 | et quelques compléments :
479 | - http://www.rennes.supelec.fr/ren/fi/elec/docs/telefon.htm
480 | - http://telecommunications.monsite-orange.fr/page-57573c36a13b9.html
481 |
--------------------------------------------------------------------------------
/docs/PCB_v1.1.0_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/PCB_v1.1.0_back.png
--------------------------------------------------------------------------------
/docs/PCB_v1.1.0_front.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/PCB_v1.1.0_front.png
--------------------------------------------------------------------------------
/docs/shield_front.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/shield_front.jpg
--------------------------------------------------------------------------------
/docs/shield_stacked.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/shield_stacked.jpg
--------------------------------------------------------------------------------
/docs/solenoid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/solenoid.png
--------------------------------------------------------------------------------
/docs/transistor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/transistor.png
--------------------------------------------------------------------------------
/docs/wiring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/wiring.png
--------------------------------------------------------------------------------
/docs/wiring_2.5.0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/docs/wiring_2.5.0.jpg
--------------------------------------------------------------------------------
/microSD_content/00/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/01/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/02/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/03/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/04/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/05/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/06/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/07/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/08/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/09/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/10/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/11/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/12/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/13/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/14/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/15/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/16/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/17/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/18/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/19/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/20/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/21/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/22/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/23/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/24/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/25/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/26/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/27/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/28/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/29/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/30/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/31/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/32/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/33/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/34/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/35/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/36/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/37/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/38/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/39/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/40/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/41/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/42/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/43/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/44/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/45/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/46/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/47/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/48/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/49/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/50/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/51/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/52/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/53/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/54/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/55/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/56/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/57/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/58/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/59/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/60/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/61/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/62/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/63/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/64/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/65/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/66/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/67/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/68/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/69/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/70/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/71/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/72/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/73/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/74/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/75/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/76/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/77/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/78/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/79/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/80/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/81/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/82/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/83/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/84/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/85/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/86/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/87/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/88/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/89/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/90/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/91/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/92/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/93/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/94/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/95/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/96/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/97/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/98/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/99/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/microSD_content/MP3/0001.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/microSD_content/MP3/0001.mp3
--------------------------------------------------------------------------------
/microSD_content/MP3/0002.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/microSD_content/MP3/0002.mp3
--------------------------------------------------------------------------------
/microSD_content/MP3/0003.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/microSD_content/MP3/0003.mp3
--------------------------------------------------------------------------------
/microSD_content/MP3/0004.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/microSD_content/MP3/0004.mp3
--------------------------------------------------------------------------------
/microSD_content/MP3/0005.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/microSD_content/MP3/0005.mp3
--------------------------------------------------------------------------------
/shield/socotel_arduino_shield_gerber (with bells) v2.5.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/shield/socotel_arduino_shield_gerber (with bells) v2.5.0.zip
--------------------------------------------------------------------------------
/shield/socotel_arduino_shield_gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThomasChappe/S63_Arduino/b1179073e098bcc3a5e02095290a678880857f82/shield/socotel_arduino_shield_gerber.zip
--------------------------------------------------------------------------------
/socotel/socotel.ino:
--------------------------------------------------------------------------------
1 | /***************************************************
2 | * Socotel S63 vintage phone revival with an arduino and a MP3 shield
3 | *
4 | * @file socotel.ino
5 | * @brief play a random MP3 song of the year your dialed on the S63
6 | *
7 | * @copyright [Thomas CHAPPE](https://github.com/ThomasChappe), 2020
8 | * @copyright GNU General Public License v3.0
9 | *
10 | * @author [Thomas CHAPPE](https://github.com/ThomasChappe)
11 | * @version 2.1.0
12 | * @date 2020-04-24
13 | *
14 | * All the documentation for this code is available here :
15 | * https://github.com/ThomasChappe/S63_Arduino/
16 | *
17 | * Arduino shield and/or wiring instructions available here :
18 | * https://github.com/ThomasChappe/S63_Arduino/#des-fils-des-connexions-un-peu-de-code-et-la-magie-prend-forme
19 | *
20 | * Extra hardware used :
21 | * - DFPlayer - A Mini MP3 Player For Arduino
22 | * https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299
23 | * https://www.dfrobot.com/product-1121.html
24 | * also available under the name "MP3-TF-16P"
25 | *
26 | * - optional Solenoid (x2) to have the bells ringing
27 | * https://www.aliexpress.com/item/32801392552.html
28 | * and to have them working and managed by the Arduino, 2x NPN transistors (TIP102) used as switches, 2x 1N4004 diods and 2x 1k resistors.
29 | *
30 | * software library required for MP3 player :
31 | * https://github.com/DFRobot/DFRobotDFPlayerMini/
32 | */
33 |
34 |
35 | #include "SoftwareSerial.h"
36 | #include "DFRobotDFPlayerMini.h"
37 |
38 | /*****
39 | ****** BEGIN OF CUSTOMIZABLE SECTION : Here, ou can modify values for timers, pins, etc...
40 | ******/
41 |
42 | // MP3 player will use a serial communication, let's initialize it with Arduino pins.
43 | SoftwareSerial mySoftwareSerial(10, 11); // RX, TX
44 | // sometime ACK messages sent on software serial seems to create bugs when trying to access to number of files in folders... strange but observed.
45 | // if you get "no file found" too often, then try to set the flag to false.
46 | const bool gc_useMP3Ack = true;
47 | // sometime you should try to disable reset flag, if your SD card isn't recognized at boot... strange but observed.
48 | // if the MP3 does not start properly at boot, then try to set the flag to false.
49 | const bool gc_resetMP3OnBoot = true;
50 | // Set volume value (0~30). /!\ 5 is clearly enough if you don't want to damage your ears !
51 | const unsigned short gc_MP3Volume = 5;
52 |
53 |
54 | // define pins used by arduino
55 | const unsigned int gc_hangUpPin = 5;
56 | // WARNING !
57 | //This pin MUST be connected to an interruption capable pin (see your Arduino board documentation to know which pin is available)
58 | const unsigned int gc_dialPin = 2; // WARNING ! Interruption pin : rotaring pulses (numbers) are caught here
59 | const unsigned int gc_rotaringPin = 4; // pin used to know if we are currently rotaring.
60 |
61 | // dial constants
62 | const unsigned int gc_pickUpTimeout = 10000; // time (ms) before occupied tone will ring (ie : too long before dialing)
63 | const unsigned int gc_dialingTimeout = 10000; // time (ms) before timeout after digit composed => launch call
64 |
65 | // SD card content definitions
66 | const unsigned int gc_minYearToCall = 1940; // older year available in SD card
67 | const unsigned int gc_maxYearToCall = 2017; // earlier year available in SD card
68 | const unsigned int gc_00YearFolderReplacementNumber = 39; // ugly trick ! folder number replacement, used for year 00 (like 2000, since folder "00" is not supported by chip :-/)
69 |
70 | // version 2.0 : added the ability to have the bells ringing by calling number : (default number : 666)
71 | const unsigned int gc_bell1Pin = 7; // the output pin for the first bell (solenoid with knock on the bell)
72 | const unsigned int gc_bell2Pin = 8; // the output pin for the second bell (solenoid with knock on the bell)
73 | const unsigned short gc_max_bell_ring = 8; // max number of ringing in the full sequence : bells will ring X time before stop. (8 times for legacy in France)
74 | const unsigned int gc_bell_ring_duration = 1500; // the bells rings for this duration (in ms) in the ringing sequence (1500ms for legacy in France)
75 | const unsigned int gc_bell_ring_delay = 3500; // the bells pause for this duration (in ms) in the ringing sequence (3500ms for legacy in France)
76 | const unsigned int gc_bell_ring_period = 17; // the bells ring one after the other, at current period (1/frequency), in ms. (50Hz => 20ms for legacy in France, but rings better at 17, IMHO)
77 | const String gc_self_call_number = "0666"; // the number to dial, to have the phone ring
78 | const unsigned int gc_delay_before_call = 2000; // delay after having self dialed and hanged up, before the phone rings (in ms).
79 |
80 | // version 2.1
81 | // rotaring can require debounce, but a small one seems to do the job
82 | // if after dialing 4 numbers your phone stay quiet, then finaly play the "occupied" tone, then maybe you should increase this value.
83 | const unsigned short gc_rotaringDebounce = 10;
84 |
85 | // some old phone seems to slow down (?) the digits pulses
86 | // adding some extra pulse time can help (or you can clean up the phone speed regulator, for example add some oil into the cage)
87 | // /!\ never go over 25 for this constant, not to miss pulses.
88 | const unsigned short gc_extraPulseTime = 20;
89 |
90 |
91 | /*****
92 | ****** END OF CUSTOMIZABLE SECTION, DO NOT CHANGE ANYTHING BELOW THIS LINE
93 | ******/
94 |
95 |
96 |
97 | // we will use special tones to bring phone back to life and simulate calls
98 | // this MP3 are stored in a special folder on SD Card. This folder is SD:/MP3/000X.mp3 (where X is the constant below)
99 | const unsigned short GC_TONE_WAITING = 1;
100 | const unsigned short GC_TONE_OCCUPIED = 2;
101 | const unsigned short GC_TONE_SEARCHING = 3;
102 | const unsigned short GC_TONE_RINGING = 4;
103 | const unsigned short GC_TONE_ERROR = 5;
104 | const unsigned short GC_TONE_CALL = 6; // special sound when asked to be called back (have the bells ringing).
105 |
106 | // we will use a status to manage code execution : check g_phoneStatus and time elapsed to decide which code is active
107 | // 0 = hanged up
108 | // 1 = tone
109 | // 2 = dialing (no tone)
110 | // 3 = finished composing number
111 | // 4 = too long waiting => occupied tone => end
112 | // 5 = playing song / mission complete !
113 | // 6 = no song found or invalid number dialed
114 | // 7 = incoming call ! The phone will ring !
115 | const unsigned short GC_PHONE_HANGED_UP = 0;
116 | const unsigned short GC_PHONE_TONE = 1;
117 | const unsigned short GC_PHONE_DIALING = 2;
118 | const unsigned short GC_PHONE_NUMBER_OK = 3;
119 | const unsigned short GC_PHONE_TIMEOUT = 4;
120 | const unsigned short GC_PHONE_CALL_OK = 5;
121 | const unsigned short GC_PHONE_NO_SOUND_SD = 6;
122 | const unsigned short GC_PHONE_INCOMING_CALL = 7;
123 | unsigned short g_phoneStatus = GC_PHONE_HANGED_UP;
124 |
125 |
126 | // declare the MP3 player
127 | DFRobotDFPlayerMini g_MP3Player;
128 |
129 |
130 | // do we need to have the phone ring now ?
131 | bool g_incomingCall = false;
132 |
133 | // phone and dial constants
134 | const unsigned int gc_pulseInterval = 66 + gc_extraPulseTime; // ms lasting of dialing pulses (see rotary specs)
135 |
136 | // debounce, rotary pulse detection and digit composed (use interruptions)
137 | volatile unsigned long g_dialTime = 0;
138 | volatile unsigned long g_lastDialTime = 0;
139 | volatile short g_currentDigitComposed = -1;
140 |
141 | // loop status and functional management
142 | unsigned long g_timer;
143 | bool g_previouslyRotaring = false;
144 |
145 | // timeout will change after 4th digit composed => accelerate switch to calling mode
146 | unsigned int g_currentDialingTimeout = gc_dialingTimeout;
147 | // the number dialed so far (string to manage number beginning by "0")
148 | String g_numberDialed = "";
149 |
150 |
151 |
152 | /****************************************************************
153 | * when a digit is composed, add it to number given in parameter
154 | */
155 | void addDigitToComposedNumber(String & p_composedNumber)
156 | {
157 | if (g_currentDigitComposed != -1)
158 | {
159 | // append digit to string, since we begin with -1, add +1, and %10 to get the "0"
160 | p_composedNumber += (g_currentDigitComposed + 1) % 10;
161 | }
162 | g_currentDigitComposed = -1; // set digit back to -1
163 | }
164 |
165 |
166 | /****************************************************************
167 | * check if rotary is currently active (digit is being composed)
168 | */
169 | bool isRotaring()
170 | {
171 | // introduce debounce for rotaring detection, since some phones had problems.
172 | int l_rotaringPinStatus;
173 | do
174 | {
175 | l_rotaringPinStatus = digitalRead(gc_rotaringPin);
176 | delay (gc_rotaringDebounce);
177 | } while ( l_rotaringPinStatus != digitalRead(gc_rotaringPin) );
178 |
179 | // if pin is HIGH, since we are in pullup mode => not rotaring
180 | return l_rotaringPinStatus == LOW;
181 | }
182 |
183 |
184 | /****************************************************************
185 | * pulse callback : used by an interruption when pulse is detected from rotary
186 | * checks if new pulse is coming, then add it to current digit composed
187 | */
188 | void rotaryPulseCallback()
189 | {
190 | g_dialTime = millis();
191 |
192 | // check we got a new pulse, not the same
193 | if (g_dialTime - g_lastDialTime >= gc_pulseInterval)
194 | {
195 | g_currentDigitComposed++; // ok, got pulse, add it
196 | g_lastDialTime = g_dialTime;
197 | }
198 | }
199 |
200 |
201 | /****************************************************************
202 | * checks if phone is hanged up
203 | */
204 | bool isPhoneHangedUp()
205 | {
206 | // if pin is HIGH, since we are un pullup mode => phone hanged up
207 | int sensorVal = digitalRead(gc_hangUpPin);
208 |
209 | // show hanged status with onboard led (just for debug / fun)
210 | if (sensorVal == HIGH) {
211 | digitalWrite(LED_BUILTIN, LOW);
212 | } else {
213 | digitalWrite(LED_BUILTIN, HIGH);
214 | }
215 |
216 | return sensorVal == HIGH;
217 | }
218 |
219 |
220 | /****************************************************************
221 | * compute folder to use on SD Card, from number called.
222 | * Translates 4 digit years to 2 digits folders
223 | * and avoir "0" folder, not supported by MP3 chip
224 | * param : the number dialed on the phone (if more than 4 digits, will take the last 4 digits to get year)
225 | * return 0 if invalid date/number is given
226 | */
227 | unsigned short getFolderFromNumberDialed(String p_numberDialed)
228 | {
229 | // get year only from input (ie : get last 4 digits)
230 | if (p_numberDialed.length() > 4)
231 | {
232 | p_numberDialed = p_numberDialed.substring(p_numberDialed.length() - 4);
233 | }
234 |
235 | unsigned short l_yearToCall = p_numberDialed.toInt();
236 |
237 | // check that year is valid
238 | if (l_yearToCall <= gc_maxYearToCall && l_yearToCall >= gc_minYearToCall)
239 | {
240 | // MP3 player only reads "01-99" folders => remove extra years numbers
241 | l_yearToCall -= 1900;
242 |
243 | // manage 1900 vs 2000 years
244 | if (l_yearToCall >= 100)
245 | {
246 | l_yearToCall -= 100;
247 | }
248 |
249 | // ugly trick : MP3 player cannot read into "00" folder =>> let's read special folder number for year 2000 ... :-/
250 | if (l_yearToCall == 0)
251 | {
252 | l_yearToCall = gc_00YearFolderReplacementNumber;
253 | }
254 |
255 | return l_yearToCall;
256 | }
257 |
258 | return 0;
259 | }
260 |
261 |
262 | /****************************************************************
263 | * get number of songs in folder, on SD Card.
264 | * then get a random song from this folder.
265 | * param : the folder to use
266 | * return 0 if unable to get a song from given folder
267 | */
268 | unsigned short getRandomSongFromFolder(unsigned short p_folderToCall)
269 | {
270 | // read file counts in folder SD:/
271 | short l_nbFilesInFolder = g_MP3Player.readFileCountsInFolder(p_folderToCall);
272 |
273 | // sometime, the sd card seems to be lazy. Strange. But fixed by a second try.
274 | if (l_nbFilesInFolder <= 0)
275 | {
276 | Serial.println("Got no file from the folder. Let's try another time, just in case of a lazy sd card");
277 | delay(100);
278 | l_nbFilesInFolder = g_MP3Player.readFileCountsInFolder(p_folderToCall);
279 | }
280 |
281 | if (l_nbFilesInFolder > 0)
282 | {
283 | Serial.println (String (l_nbFilesInFolder) + " files found in folder");
284 | long l_songNumber = random(1, l_nbFilesInFolder + 1);
285 | Serial.println ("Random selection of music : done. We will play song number : " + String(l_songNumber) );
286 | return l_songNumber;
287 | }
288 |
289 | // empty folder or error trying to get files
290 | return 0;
291 | }
292 |
293 |
294 | /****************************************************************
295 | * called when everything is allright, so let's play song !
296 | * but before, it will emulate the old song of a french phone long distance call, then ring.
297 | * params : the folder to use and the file number to play
298 | */
299 | void callAndPlaySong (unsigned short p_folderToCall, unsigned short p_fileToPlay)
300 | {
301 | // let's emulate long call (on old french phone lines)
302 | g_MP3Player.playMp3Folder(GC_TONE_SEARCHING); //play specific mp3 in SD:/MP3/0003.mp3; => searching line
303 | delay(3000);
304 | g_MP3Player.playMp3Folder(GC_TONE_RINGING); //play specific mp3 in SD:/MP3/0004.mp3; => ringing !
305 | delay(6000);
306 |
307 | Serial.println ("Call succeed : now play song !");
308 | Serial.println("Play random song number : " + String(p_fileToPlay));
309 |
310 | //play mp3 in SD://.mp3; Folder Name(1~99); File Name(1~255)
311 | g_MP3Player.playFolder(p_folderToCall, p_fileToPlay);
312 | }
313 |
314 |
315 | /*
316 | * ring the phone bells. Plays the full and genuine sequence of ringing :
317 | * - ring for gc_bell_ring_duration, knocking the bells at gc_bell_ring_period
318 | * - wait for gc_bell_ring_delay before ringing again
319 | * - repeat it gc_max_bell_ring times.
320 | *
321 | * if phone is picked up => ring stops immediately.
322 | *
323 | * put solenoid pins low before exit, in order to avoid the solenoid to get hot and drain power.
324 | */
325 | void ringBells ()
326 | {
327 | long l_toneBeginTime = millis();
328 |
329 | // ring the specified number of time, and stop ringing if phone is picked up
330 | for (unsigned short l_ringCount = 0 ; l_ringCount < gc_max_bell_ring && ( isPhoneHangedUp());)
331 | {
332 | long l_currentTime = millis();
333 | if (l_currentTime - l_toneBeginTime < gc_bell_ring_duration)
334 | {
335 | // let's ring for the right duration
336 | delay(gc_bell_ring_period);
337 | digitalWrite (gc_bell1Pin, LOW);
338 | digitalWrite (gc_bell2Pin, HIGH);
339 | delay(gc_bell_ring_period);
340 | digitalWrite (gc_bell2Pin, LOW);
341 | digitalWrite (gc_bell1Pin, HIGH); // finish sequence with one bell high too let one bell "ring" (better sound !)
342 | }
343 | else if (l_currentTime - l_toneBeginTime > gc_bell_ring_delay)
344 | {
345 | // let's wait between rings for the right duration
346 | l_toneBeginTime = l_currentTime;
347 | l_ringCount ++;
348 | }
349 | }
350 |
351 | // avoid to send useless power to solenoid when not ringing and have them get too hot
352 | digitalWrite (gc_bell2Pin, LOW);
353 | digitalWrite (gc_bell1Pin, LOW);
354 | }
355 |
356 |
357 | /*
358 | * a simple function to check if we are calling ourselve : do we want the phone to ring ?
359 | *
360 | * return true if we just dialed the special "self call" number.
361 | */
362 | inline bool isSelfCalling (String p_numberDialed)
363 | {
364 | return p_numberDialed == gc_self_call_number;
365 | }
366 |
367 |
368 |
369 |
370 |
371 | /****************************************************************
372 | * the standard Arduino setup function
373 | */
374 | void setup()
375 | {
376 | //start serial connection for MP3 player AND for debug traces
377 | mySoftwareSerial.begin(9600);
378 | Serial.begin(115200);
379 |
380 | //configure pin as an input and enable the internal pull-up resistor => phone up or down ?
381 | pinMode(gc_hangUpPin, INPUT_PULLUP);
382 | pinMode(LED_BUILTIN, OUTPUT); /* DEBUG only : internal led is on when phone is working */
383 |
384 | // configure rotary dial pin to get pulses (and attach interruption callback)
385 | pinMode(gc_dialPin, INPUT_PULLUP);
386 | attachInterrupt(digitalPinToInterrupt(gc_dialPin), rotaryPulseCallback, RISING);
387 |
388 | //configure pin as an input and enable the internal pull-up resistor => rotaring or not ?
389 | pinMode(gc_rotaringPin, INPUT_PULLUP);
390 |
391 | // configure pins for the bells and ringing
392 | pinMode(gc_bell1Pin, OUTPUT);
393 | pinMode(gc_bell2Pin, OUTPUT);
394 | digitalWrite (gc_bell1Pin, LOW);
395 | digitalWrite (gc_bell2Pin, LOW);
396 |
397 | Serial.println();
398 | Serial.println(F("Welcome to Socotel S63 Arduino revival !"));
399 | Serial.println();
400 | Serial.println(F("Initializing MP3 player, please wait... (about 3 seconds)"));
401 |
402 | delay(2000); // MP3 player seem to need time to boot.
403 |
404 | // Use softwareSerial to communicate with mp3,
405 | if ( ! g_MP3Player.begin(mySoftwareSerial, gc_useMP3Ack, gc_resetMP3OnBoot) )
406 | {
407 | Serial.println(F("Unable to begin:"));
408 | Serial.println(F("1.Please recheck the connection!"));
409 | Serial.println(F("2.Please insert the SD card!"));
410 | Serial.println(F("3.If it still fail : try to change MP3 flags in configuration"));
411 | while (true);
412 | }
413 | Serial.println(F("MP3 player ready"));
414 |
415 | delay(1000); // and more time to listen to its serial port
416 |
417 |
418 | //----Setup MP3 player ----
419 | //Set serial communication time out 800ms (bellow seems to create errors when getting SD files number)
420 | g_MP3Player.setTimeOut(800);
421 | g_MP3Player.volume(gc_MP3Volume);
422 | g_MP3Player.EQ(DFPLAYER_EQ_NORMAL); // Set EQ
423 | g_MP3Player.outputDevice(DFPLAYER_DEVICE_SD); // Set device we use : SD card
424 |
425 | // generate random number : from Arduino documentation :
426 | // analog input pin 0 is unconnected, random analog
427 | // noise will cause the call to randomSeed() to generate
428 | // different seed numbers each time the sketch runs.
429 | // randomSeed() will then shuffle the random function.
430 |
431 | // personnal side note : reading the pin only once is not enough and produce too predictive results...
432 | // so, add some (ugly) randomness (that works to randomize the song order)
433 | unsigned long l_seed = analogRead(A0);
434 | l_seed *= analogRead(A0);
435 | l_seed *= analogRead(A0);
436 | l_seed /= analogRead(A0);
437 | l_seed *= analogRead(A0);
438 | l_seed *= analogRead(A0);
439 | l_seed /= analogRead(A0);
440 | l_seed += analogRead(A0);
441 | Serial.println ("Songs are randomized with random seed : " + String (l_seed));
442 | randomSeed(l_seed);
443 |
444 | // timer is used to compute delays and timeout
445 | g_timer = millis();
446 |
447 | Serial.println();
448 | Serial.println("Socotel Ready ! Let's go !");
449 | Serial.println();
450 | }
451 |
452 |
453 |
454 |
455 |
456 | /****************************************************************
457 | * the standard Arduino main loop function
458 | */
459 | void loop()
460 | {
461 | if (isPhoneHangedUp())
462 | {
463 | g_MP3Player.pause(); // stop sounds
464 |
465 | // phone is hanged up. Did we program an incoming call ?
466 | if (g_phoneStatus == GC_PHONE_INCOMING_CALL)
467 | {
468 | // wait a little, not to have the phone calling instantly after hanged up
469 | delay (gc_delay_before_call);
470 | ringBells();
471 | }
472 |
473 | // reset previous variables since we hanged up.
474 | g_phoneStatus = GC_PHONE_HANGED_UP;
475 | g_numberDialed = "";
476 | g_currentDigitComposed = -1;
477 | g_currentDialingTimeout = gc_dialingTimeout;
478 | g_timer = millis();
479 | }
480 | else
481 | {
482 | // phone is picked up, are we rotaring a digit ?
483 | if (isRotaring() && g_phoneStatus < GC_PHONE_NUMBER_OK)
484 | {
485 | g_timer = millis(); // no timeout while rotaring
486 | if ( (!g_previouslyRotaring) )
487 | {
488 | addDigitToComposedNumber(g_numberDialed); // if not first digit => we need to add it to number
489 | Serial.println ("Start rotaring, adding previous digit. Number so far : " + String(g_numberDialed) );
490 | g_previouslyRotaring = true;
491 | g_phoneStatus = GC_PHONE_DIALING;
492 | g_MP3Player.pause(); // stop playing tone when dialing starts
493 |
494 | // if we already have 3 digits and we start dialing the 4th, reduce timeout, to start call quickly
495 | if (g_numberDialed.length() == 3)
496 | {
497 | g_currentDialingTimeout = 500;
498 | }
499 | }
500 | }
501 | else
502 | {
503 | g_previouslyRotaring = false;
504 |
505 | if ( (millis() - g_timer > g_currentDialingTimeout) && (g_currentDigitComposed != -1) && g_phoneStatus < GC_PHONE_NUMBER_OK )
506 | {
507 | // digit has been composed, and timeout reached => add digit to number, then call !
508 | addDigitToComposedNumber(g_numberDialed);
509 | Serial.println ("Time out for rotaring. Now calling : " + String(g_numberDialed));
510 | g_phoneStatus = GC_PHONE_NUMBER_OK;
511 | }
512 |
513 | // time out not reached, phone just picked up => tone
514 | if (millis() - g_timer < gc_pickUpTimeout && g_phoneStatus == GC_PHONE_HANGED_UP)
515 | {
516 | g_phoneStatus = GC_PHONE_TONE;
517 | Serial.println ("Phone picked up : let's tone");
518 | g_MP3Player.playMp3Folder(GC_TONE_WAITING); //play specific mp3 in SD:/MP3/0001.mp3; File Name(0~65535) => A3 Tone
519 | }
520 |
521 | // timeout and no digit => occupied tone
522 | if (millis() - g_timer > gc_pickUpTimeout && (g_phoneStatus == GC_PHONE_TONE || g_phoneStatus == GC_PHONE_DIALING))
523 | {
524 | g_phoneStatus = GC_PHONE_TIMEOUT;
525 | Serial.println ("Time out and no digit dialed : occupied tone");
526 | g_MP3Player.playMp3Folder(GC_TONE_OCCUPIED); //play specific mp3 in SD:/MP3/0002.mp3; => occupied tone
527 | }
528 |
529 | // we got a number to call ! => go for it !
530 | if (g_phoneStatus == GC_PHONE_NUMBER_OK)
531 | {
532 | Serial.println ("Start calling : check number");
533 |
534 | unsigned short l_folderToCall = getFolderFromNumberDialed(g_numberDialed);
535 |
536 | // if invalid date
537 | if (! l_folderToCall)
538 | {
539 | // check special numbers : did we ask to be recalled ? (and btw, "who you gonna call ?" :-) )
540 | if (isSelfCalling(g_numberDialed))
541 | {
542 | Serial.println("Phone asked to be recalled. Let's program an incoming call ! Please hang up !");
543 | g_phoneStatus = GC_PHONE_INCOMING_CALL;
544 | //notify user that call is scheduled : play specific mp3 in SD:/MP3/0006.mp3; => special call back tone !
545 | g_MP3Player.playMp3Folder(GC_TONE_CALL);
546 | }
547 | else
548 | {
549 | Serial.println("Invalid year called, play error tone");
550 | g_phoneStatus = GC_PHONE_NO_SOUND_SD;
551 | g_MP3Player.playMp3Folder(GC_TONE_ERROR); //play specific mp3 in SD:/MP3/0005.mp3; => error tone !
552 | }
553 | }
554 | else
555 | {
556 | // play random song from folder, if exists.
557 | Serial.println("Ok, valid number. Calling year : " + g_numberDialed + " => folder : " + l_folderToCall);
558 | unsigned short l_fileToPlay = getRandomSongFromFolder(l_folderToCall);
559 |
560 | if (l_fileToPlay <= 0)
561 | {
562 | Serial.println("No file found in folder, play error tone");
563 | //if no file in folder =>> play error tone
564 | g_phoneStatus = GC_PHONE_NO_SOUND_SD;
565 | g_MP3Player.playMp3Folder(GC_TONE_ERROR); //play specific mp3 in SD:/MP3/0005.mp3; => error tone !
566 | }
567 | else
568 | {
569 | Serial.println ("Songs found in folder ! Play search then ringing tone");
570 | g_phoneStatus = GC_PHONE_CALL_OK;
571 | callAndPlaySong (l_folderToCall, l_fileToPlay);
572 | }
573 | }
574 | }
575 | }
576 | }
577 | }
578 |
--------------------------------------------------------------------------------